Electricity meter clock error calibration system and calibration method
By designing an electricity meter clock error calibration system, fully automated testing and calibration of the electricity meter clock error is achieved, solving the problems of low efficiency and poor reliability in the existing technology, improving test efficiency and accuracy, and supporting flexible selection of multiple MCU chips.
Patent Information
- Application Number
- CN202510880058.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-27
AI Technical Summary
The existing electricity meter clock error calibration process relies on manual operation, which is inefficient and unreliable. Batch testing cannot be achieved, and the test results are not stable and reliable enough.
A clock error calibration system for electricity meters is designed, including a host computer, a clock instrument, a clock signal relay, and a high and low temperature chamber. Clock error testing and calibration at multiple temperature points are achieved through automated control. Multiple automatic adjustment schemes are used to adapt to different types of electricity meter MCUs, realizing fully automated clock error calibration.
It improves the efficiency and accuracy of electricity meter clock error testing and calibration, reduces manpower requirements, improves test stability and reliability, supports flexible selection of multiple MCU chips, and meets application requirements in different scenarios.
Smart Images

Figure CN120370654B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power electronics, and in particular relates to an electric energy meter clock error calibration system and a calibration method. Background Art
[0002] A real-time clock (RTC) is an integrated circuit that provides a precise time reference for electronic systems. In electricity meters, the clock stores various time-stamped information and records the occurrence and recovery times of various events, ensuring the accuracy of data acquisition, metering, calculations, and control. Most electricity meter clocks are based on crystal oscillators. Because the frequency of crystal oscillators varies with ambient temperature, temperature compensation is required to ensure the accuracy of the crystal oscillator frequency and, therefore, the clock.
[0003] The temperature-frequency curve used by the electricity meter's crystal oscillator is a quadratic curve, significantly affected by temperature. Therefore, clock error compensation at multiple temperature points is required to ensure the accuracy of the crystal oscillator's fitting curve while minimizing fitting error. This requires placing the electricity meter in a high-temperature chamber and performing daily timing error correction at low, normal, and high temperatures, including -25°C, 23°C, 27°C, and 55°C, to meet the error requirements for State Grid inspection. However, the existing technology for daily time error correction testing requires manual operation of the clock meter and the high and low temperature chamber equipment, as well as the sequential modification of the temperature chamber operating temperature and the reading of the clock meter's daily time error, which is time-consuming and tiring. In addition, a single reading of the daily time error requires recording the average value of the error within a few minutes, and can only be tested in sequence by meter number, making batch correction testing impossible. Furthermore, the operator may misrecord or omit the clock error or write the wrong correction value into the meter, resulting in failure of the daily time error correction, and the stability and reliability of the test correction effect are insufficient. In addition, the daily time of the meter needs to be repeatedly adjusted at several temperature points to fit the standard curve, and the high and low temperature chamber has a long operating time for a round, so manual testing alone has low time utilization. Therefore, the existing clock temperature compensation test process requires a large amount of manpower for repetitive operations, which is not in line with the trend of industrial automation. In addition, the stability and reliability of the test correction effect are insufficient. It also does not consider the recording of clock error correction results, making it impossible to trace meters with excessive clock errors. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide an electric energy meter clock error calibration system and calibration method, which can realize automatic and accurate clock error adjustment and significantly improve calibration efficiency and calibration accuracy.
[0005] In order to solve the above technical problems, the first technical solution adopted by the present invention is:
[0006] A system for calibrating clock errors of electric energy meters comprises: a host computer, a high-temperature and low-temperature chamber, a clock instrument, a clock signal relay, and a plurality of electric energy meters to be tested; the host computer is respectively connected to the high-temperature and low-temperature chamber, the clock instrument, the clock signal relay, and the plurality of electric energy meters to be tested; the clock instrument is also connected to the clock signal relay; the clock signal relay is also respectively connected to the clock signal terminals of the plurality of electric energy meters to be tested; the plurality of electric energy meters to be tested are placed in the high-temperature and low-temperature chamber;
[0007] The host computer is configured to preset a control schedule for the high and low temperature chambers and at least two automatic adjustment schemes, wherein the control schedule includes temperature points corresponding to at least three rounds of tests and their operating times and table numbers; and
[0008] When executing the high and low temperature adjustment mode, adjusting the temperature of the high and low temperature box according to the control schedule; and
[0009] In each round of testing, the clock signal relay switches the connected meter number, obtains the currently connected meter number, and obtains the daily timing error message of the currently connected meter number in each round of testing through the clock instrument; and
[0010] Parse the received daily time error message, obtain PPM and S / D data, and store them in association with the currently connected meter number; and
[0011] Calculate the average of all PPM and S / D data obtained in each round of testing for each meter number to obtain a clock error value including the PPM average and the S / D average; and
[0012] After each round of testing, according to the automatic adjustment scheme selected for each meter number, the RTC adjustment frame is assembled from the clock error values corresponding to each meter number and sent to the corresponding electric energy meter under test; and
[0013] Verify the RTC adjustment result of the tested electric energy meter that receives the RTC adjustment frame until the RTC adjustment result meets the requirement or the RTC adjustment times are reached.
[0014] Optionally, the host computer is connected to the high and low temperature box, the clock instrument, the clock signal relay and the plurality of electric energy meters to be tested via serial ports respectively.
[0015] Optionally, the clock signal relay includes a single chip microcomputer, a first resistor, a second resistor, a third resistor, a transistor, a light emitting diode, a freewheeling diode and a relay;
[0016] The control pin of the single-chip microcomputer is connected to the base of the transistor through a first resistor; the ground pin of the single-chip microcomputer is connected to the base of the transistor through a second resistor, and is directly connected to the emitter of the transistor; the VCC pin of the single-chip microcomputer is divided into three paths, one path is connected to the collector of the transistor via a third resistor and a light-emitting diode in sequence, one path is connected to the collector of the transistor via a freewheeling diode, and one path is connected to the collector of the transistor via an input circuit of a relay; the common end in the output circuit of the relay is connected to the clock pulse end of the electric energy meter under test, and the normally open end is connected to the clock instrument.
[0017] Another technical solution provided by the present invention is:
[0018] A method for calibrating an electric energy meter clock error is implemented based on the above-mentioned electric energy meter clock error calibration system, comprising:
[0019] S1: Preset a control schedule for the high and low temperature chamber and at least two automatic adjustment schemes, wherein the control schedule includes the temperature points corresponding to at least three rounds of tests and their operating times and table numbers;
[0020] S2: The host computer executes the high and low temperature adjustment mode and adjusts the temperature of the high and low temperature box according to the control schedule;
[0021] S3: The host computer switches the connected meter number through the clock signal relay in each round of testing, obtains the currently connected meter number, and obtains the daily timing error message of the currently connected meter number in each round of testing through the clock instrument;
[0022] S4: The host computer parses the received daily time error message, obtains PPM and S / D data, and associates and stores them with the currently connected meter number;
[0023] S5: The host computer calculates the mean of all PPM and S / D data obtained in each round of testing for each meter number, and obtains the clock error value including the PPM mean and the S / D mean;
[0024] S6: After each round of testing, the host computer assembles an RTC adjustment frame from the clock error values corresponding to each meter number according to the automatic adjustment scheme selected for each meter number and sends it to the corresponding measured energy meter;
[0025] S7: The host computer verifies the RTC adjustment result of the measured electric energy meter that receives the RTC adjustment frame until the RTC adjustment result meets the requirement or the RTC adjustment times are reached.
[0026] Optionally, the at least two automatic adjustment schemes include:
[0027] The above two automatic adjustment schemes correspond to different types of electricity meter MCUs, including:
[0028] The first automatic adjustment scheme includes: obtaining the S / D mean value based on the clock error value corresponding to the meter number in the current test round, assembling it according to the single-phase meter frame format, and adding its total sum verification code to splice it to obtain the RTC adjustment frame;
[0029] The second automatic adjustment scheme includes: obtaining the S / D mean value based on the clock error value corresponding to the meter number in this round of testing, assembling it according to the three-phase meter frame format, and adding its total sum verification code to splice it to obtain the RTC adjustment frame;
[0030] The third automatic adjustment scheme includes: turning off RTC temperature compensation, obtaining the PPM mean value based on the clock error value corresponding to the meter number in this round of testing, adding and accumulating it with the PPM mean value in the previous round of testing, and assembling it, adding the total sum verification code, and reading the current ADC value of the meter number at the same time to obtain the RTC adjustment frame.
[0031] Optionally, the S7 specifically includes:
[0032] The host computer once again obtains the clock error value of the meter number; if the clock error value is within the error threshold, the adjustment of the corresponding tested electric energy meter in this round of testing is completed; if the clock error value is outside the error threshold, it returns to execute step S3 until the RTC adjustment result meets the requirements or the RTC adjustment times are reached.
[0033] Optionally, the S3 specifically includes:
[0034] S31: In this round of testing, have all selected table numbers been traversed? If so, return to S2 and switch to the next round of testing; if not, execute S32;
[0035] S32: The host computer switches the connected meter number through the clock signal relay, reads the currently connected meter number and the temperature inside the meter, and obtains all daily timing error messages of the currently connected meter number in this round of testing through the clock meter.
[0036] Optionally, it also includes:
[0037] SS2: The host computer executes the normal temperature adjustment mode;
[0038] SS3: The host computer switches the connected meter number through the clock signal relay, reads the currently connected meter number and the temperature inside the meter, and obtains the daily time error message of the currently connected meter number through the clock instrument;
[0039] SS4: The host computer parses the received daily time error message, obtains PPM and S / D data, and obtains a clock error value including the PPM and S / D data;
[0040] SS5: The host computer assembles an RTC adjustment frame from the clock error value according to the automatic adjustment scheme selected for the currently connected meter number and sends it to the corresponding measured energy meter;
[0041] SS6: The host computer verifies the RTC adjustment result of the measured electric energy meter that receives the RTC adjustment frame until the RTC adjustment result meets the requirements or the RTC adjustment times are reached.
[0042] Optionally, it also includes:
[0043] S8: The host computer generates a fluctuation curve diagram of the PPM and S / D data corresponding to each measured electric energy meter with respect to time by rendering in real time, and displays the fluctuation curve diagram.
[0044] Optionally, it also includes:
[0045] S9: After executing the high and low temperature adjustment mode, the host computer generates a corresponding structured report, which includes an error report before and after adjustment for each table number, a high and low temperature box execution time and its corresponding temperature statistics table, and the fluctuation curve diagram.
[0046] The present invention has the following beneficial effects: During the clock error test process, the present invention can automatically switch between high, low, and normal temperature points based on a preconfigured high and low temperature chamber control schedule; during the clock error adjustment process, the present invention can automatically adjust the RTC for various types of power meter MCUs based on a preconfigured multiple RTC automatic adjustment schemes. The resulting automated process for power meter clock error testing and calibration can significantly improve the efficiency and accuracy of testing and calibration, and can achieve real-time test data analysis and visualization to better meet the application needs of different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of the structure of an electric energy meter clock error calibration system provided by an embodiment of the present invention;
[0048] Figure 2 A schematic structural diagram of a clock signal relay in an electric energy meter clock error calibration system provided by an embodiment of the present invention;
[0049] Figure 3 A schematic diagram of the software flow of the electric energy meter clock error calibration system provided by an embodiment of the present invention;
[0050] Figure 4 This is an example diagram of the frame message format sent by the clock instrument in an embodiment of the present invention;
[0051] Figure 5 This is an example diagram of the frame message format received by the clock instrument in an embodiment of the present invention;
[0052] Figure 6 This is an example diagram of a fluctuation curve generated by real-time rendering in the host computer front-end interface in an embodiment of the present invention;
[0053] Figure 7 This is an example diagram of the configuration interface displayed on the front-end interface of the host computer in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.
[0055] Glossary
[0056] PPM (parts per million) is a commonly used unit of precision used to describe the frequency characteristic parameters of a crystal. It represents the relative deviation of clock frequency or time error, that is, the clock offset per million units of time.
[0057] S / D (Seconds Per Day) directly indicates the absolute time error accumulated by the clock every day, that is, the clock error is offset by a few seconds in a day.
[0058] There is a conversion relationship between PPM and S / D, 1PPM=0.0864S / D. Example 1
[0059] Please refer to Figure 1 , this embodiment provides an electric energy meter clock error calibration system, such as Figure 1 As shown, it includes a host computer, a high-temperature and low-temperature chamber, a clock, a clock signal relay, and multiple electric energy meters to be tested (i.e., meters 1 to 24 in the figure). The host computer is respectively connected to the high-temperature and low-temperature chamber, the clock, the clock signal relay, and the multiple electric energy meters to be tested; the clock is also connected to the clock signal relay; the clock signal relay is also respectively connected to the clock signal terminals of the multiple electric energy meters to be tested; and the multiple electric energy meters to be tested are placed in the high-temperature and low-temperature chamber.
[0060] In some embodiments, such as Figure 1 As shown, the host computer is connected to the high-temperature and low-temperature chamber, clock instrument, clock signal relay, and multiple measured energy meters through serial ports, i.e., COM ports. For better identification, in this embodiment, the communication port between the host computer and the high-temperature and low-temperature chamber is referred to as the "high-temperature and low-temperature chamber COM port"; the communication port between the host computer and the clock instrument is referred to as the "clock instrument COM port"; the communication port between the host computer and the clock signal relay is referred to as the "clock signal relay COM port"; and the communication port between the host computer and the measured energy meter is referred to as the "energy meter COM port."
[0061] In this embodiment, the host computer is configured to preset a control schedule for the high and low temperature chamber and at least two automatic adjustment schemes, wherein the control schedule includes the temperature points corresponding to at least three rounds of testing and their operating times, and a meter number (herein, specifically referring to the identifier of the tested electric energy meter, which can be a meter position or a unique identifier, such as an electric energy meter number); and
[0062] When executing the high and low temperature adjustment mode, adjusting the temperature of the high and low temperature box according to the control schedule; and
[0063] In each round of testing, the clock signal relay switches the connected meter number, obtains the currently connected meter number, and obtains the daily timing error message of the currently connected meter number in each round of testing through the clock instrument; and
[0064] Parse the received daily time error message, obtain PPM and S / D data, and store them in association with the currently connected meter number; and
[0065] Calculate the average of all PPM and S / D data obtained in each round of testing for each meter number to obtain a clock error value including the PPM average and the S / D average; and
[0066] After each round of testing, according to the automatic adjustment scheme selected for each meter number, the RTC adjustment frame is assembled from the clock error values corresponding to each meter number and sent to the corresponding electric energy meter under test; and
[0067] Verify the RTC adjustment result of the tested electric energy meter that receives the RTC adjustment frame until the RTC adjustment result meets the requirement or the RTC adjustment times are reached.
[0068] The working principle of the electric energy meter clock error calibration system provided in this embodiment is as follows:
[0069] The host computer sends the high and low temperature box initialization instruction to the high and low temperature box through the high and low temperature box COM port to establish a data interactive connection relationship between the two; the host computer is pre-configured with a control schedule for the high and low temperature box and at least two automatic adjustment schemes; when the host computer executes the high and low temperature adjustment mode, it will generate a set of sequentially executed timer logic based on the control schedule and the configured automatic adjustment scheme to manage the scheduling and execution of the adjustment tasks. Each timer task in the timer logic corresponds to the operating temperature point and operating time of the high and low temperature box in the control schedule, and the steps of adjusting the high and low temperature box temperature, waiting for the high and low temperature box to complete the specified operating time, switching the connection of the selected table number in turn, writing the adjustment value according to the configured automatic adjustment scheme, and verifying the adjustment result are cyclically executed until all the selected table numbers have completed multiple rounds of testing and automatic adjustment at multiple temperature points.
[0070] The electric energy meter clock error calibration system provided in this embodiment can solve the problems of low efficiency, poor reliability, high manpower cost and high time cost in the existing daily timing error adjustment test of the electric energy meter clock accuracy test under the ambient temperature through the coordinated communication of the upper computer with the high and low temperature chamber, clock instrument, clock signal relay and multiple electric energy meters under test; realize fully automated operation and coordinated scheduling of multiple hardware devices, thereby reducing manpower requirements, reducing time cost and improving time utilization; at the same time, improve test efficiency and accuracy, reduce after-sales repairs due to program defects, and enhance product competitiveness. Example 2
[0071] This embodiment further refines and expands upon the above-mentioned embodiment 1.
[0072] The power meter clock error calibration system provided in this embodiment has a host computer such as a PC that has software programs running and can directly issue control commands. Below, the structure of the power meter clock error calibration system of this embodiment will be described in detail using a PC as the host computer.
[0073] 1. Hardware configuration
[0074] The PC side is equipped with high and low temperature communication components, multiple COM communication modules and supports Windows operating system.
[0075] The clock signal relay is configured with multiple access terminals corresponding to the clock ports of the electric energy meter under test, and the clock signal relay COM port corresponding to the PC end; after receiving the command to switch the table position from the PC end, it can close the clock port of the specified table position, thereby filtering and outputting the clock signal of the specified electric energy meter to the clock instrument.
[0076] In some specific embodiments, the structure of the clock signal relay is as follows: Figure 2 As shown, it includes a single chip microcomputer, a first resistor R1, a second resistor R2, a third resistor R3, a transistor Q1, a light emitting diode LED1, a freewheeling diode U1 and a relay COM.
[0077] The conversion control signal generated by the microcontroller is output through the control pin, amplified by transistor Q1, and then drives the switching action of relay COM. The input circuit of relay COM is connected between the emitter and collector of transistor Q1, and its on / off state is controlled by the conversion control signal output by the microcontroller to the base of transistor Q1. The common terminal of relay COM's output circuit is connected to the clock pulse terminal of the energy meter, the normally open terminal is connected to the clock meter, and the normally closed terminal remains floating. A first resistor R1 is connected in series with the base circuit of transistor Q1 to achieve current limiting. A second resistor R2 is used to stabilize the base potential to ground. A third resistor R3 is connected in series with light-emitting diode LED1 and then connected to the collector circuit of transistor Q1. A freewheeling diode U1 is connected in parallel across this branch to release residual energy in the coil when relay COM is disconnected, preventing induced voltage from damaging transistor Q1. When the microcontroller triggers relay COM to close, light-emitting diode LED1 illuminates, indicating that the meter is currently in calibration.
[0078] The clock instrument can be implemented using the FME05006 clock error meter. It is equipped with a clock instrument COM port connected to a PC, which outputs a daily time error message after receiving a request from the host computer. It is also equipped with a clock signal line, whose positive and negative poles are connected to a clock signal relay, and can receive clock signals from a specified electricity meter after being filtered by the clock signal relay.
[0079] The high and low temperature chamber can be implemented using the ES0480JS high and low temperature test chamber. It is equipped with a high and low temperature chamber COM port connected to the PC. Communication is achieved by calling the dynamic link library DLL. After completing the handshake operation with the PC application, the high and low temperature chamber can be started, the operating temperature can be adjusted, the operating status of the chamber can be checked, and the operation of the high and low temperature chamber can be stopped.
[0080] The energy meter under test, as the test target instrument, includes energy meters implemented with different MCU chips such as HT6025, FM33A048, etc. Preferably, multiple energy meters under test can be uniformly set in one test fixture and regarded as one hardware device, which is more convenient for operation and management.
[0081] In particular, this application supports corresponding different types of MCU microcontroller units, and achieves more targeted and accurate automatic adjustment by presetting automatic adjustment schemes adapted to them.
[0082] 2. Key parameter configuration
[0083] (1) Communication parameters: The baud rate of the clock meter and clock signal relay is fixed at 9600 bps, with 8 data bits, no parity, and 1 stop bit. The baud rate of the energy meter can be selected in the range of 2400-115200 bps, with 8 data bits, even parity, and 1 stop bit.
[0084] (2) Environmental requirements: temperature -25±55℃, humidity ≤60% RH.
[0085] 3. System software process
[0086] The electric energy meter clock error calibration system provided in this embodiment uses SpringBoot+BootStrap as the front-end and back-end framework to implement the Web platform development of the PC host computer and conduct joint debugging and communication with four devices: high and low temperature box, electric energy meter, clock signal relay, and clock instrument.
[0087] In this embodiment, the software program configuration of the PC host computer is mainly used to implement the following functions:
[0088] (1) Configuration of the communication serial port;
[0089] (2) Connect and configure the timing tasks of high and low temperature boxes;
[0090] (3) Clock signal relay switching position;
[0091] (4) Sending and receiving energy meter 698 protocol request frames;
[0092] (5) Acquisition of daily timing error data of clock instrument;
[0093] (6) Assembly and sending of RTC adjustment frames;
[0094] (7) Clock error check after adjustment;
[0095] (8) Exception handling and logging;
[0096] (9) Test report generation.
[0097] In some specific implementations, this embodiment provides a system for calibrating an electric energy meter clock error, combined with Figure 3 The complete system software process includes the following steps:
[0098] 1. System initialization and communication establishment
[0099] After the PC software is started, it automatically scans the available COM ports and waits for the user to fill in the clock signal relay serial port, clock instrument serial port, electric energy meter serial port, high and low temperature chamber serial port, as well as the control schedule and automatic adjustment plan of the high and low temperature chamber.
[0100] 2. Connect the high and low temperature box and configure the scheduled task
[0101] The PC software sends the initialization command to the high and low temperature chamber through the high and low temperature chamber's COM port to establish an application connection with the high and low temperature chamber. When the PC software can read the temperature inside the high and low temperature chamber in real time, the handshake is successful. After the connection is successful, communication with the high and low temperature chamber can be carried out to exchange data.
[0102] Before performing fully automated adjustment on the PC side, it is necessary to confirm that a control schedule of a high and low temperature chamber is configured, specify the temperature points and operating time for each round of testing, and check the meter position to enter the automatic adjustment process (when a test fixture is configured to uniformly place the electric energy meters to be tested, the meter position can be directly checked, such as checking the specified table position in 1-24 to select the electric energy meter to be tested), so as to achieve efficient and convenient selection of the meter number of the electric energy meter to be tested.
[0103] After checking the table position for automatic adjustment and configuring the control schedule of the high and low temperature box, you can enter the daily timing automatic adjustment process according to the trigger instruction. The system will automatically generate a set of sequential execution timer logic according to the control schedule input by the user to manage the scheduling and execution of tasks. Each timer task corresponds to the operating temperature point and operating time of the high and low temperature box in the time control table. It adjusts the temperature of the high and low temperature box, waits for the high and low temperature box to complete the specified operating time, switches the clock signal relay for the selected table position in turn, writes the adjustment value according to the configured automatic adjustment scheme, and verifies the adjustment result. The steps are executed in a loop until the selected table position completes all the timing tasks of the control schedule of the high and low temperature box and records the temperature points of the high and low temperature box during operation. If the high and low temperature box control schedule is not configured, only one round of normal temperature adjustment mode is required for the selected table position, that is, the daily timing adjustment process at normal temperature.
[0104] 3. Clock signal relay switching position
[0105] The preferred clock signal relay adopts an automatic conversion control circuit based on a single-chip microcomputer, in which the output circuit of the relay is connected to the clock signal port of the electric energy meter under test, and the output circuit is connected to the clock instrument. The clock error adjustment at each temperature point in each round of testing is achieved by switching to a different table position by closing the circuit of the clock signal relay, so that the clock instrument can obtain the clock signal of the specified table position among the 1-24 tables. Specifically, after the user selects the target table position from table positions 1 to 24 in the PC software, a transmission frame will be generated and sent to the clock signal relay through the COM port of the clock signal relay, so that it closes the clock signal circuit of the target table position, thereby switching the clock signal of the electric energy meter that can be received by the clock instrument.
[0106] 4. Sending and receiving energy meter 698 protocol request frames
[0107] The PC software sends a 698 request frame to the electricity meter through the electricity meter COM port, and performs frame structure analysis, CRC check and status code analysis on the return frame in sequence; if the check is successful, the meter data such as the meter number and internal temperature of the meter are parsed from the information body of the return frame, and the parsed meter data is stored and recorded.
[0108] 5. Acquisition of daily timing error data of clock instrument
[0109] The PC software sends a request frame to the clock instrument through the clock instrument COM port; the clock instrument sends a frame (the frame message format is as follows Figure 4 As shown) to the clock signal relay, requesting to obtain the clock signal of the current closed circuit of the relay; the clock instrument receives the message returned by the clock signal relay (the received frame message format is as shown Figure 5 As shown in the figure, the data is converted into PPM information and encapsulated into the return frame. After receiving the return frame from the clock instrument, the PC parses the return frame format of the clock instrument to determine whether it is returned correctly. If the format is correct, the required PPM and S / D data are parsed from the return frame information body. If the format is incorrect, the error type is recorded and a status code is returned. The severity of the error is used to determine whether to continue cyclically sending frames to the clock instrument. After each round of frame sending and parsing, the arithmetic average of PPM and S / D is calculated respectively, and the calculated daily time error value (including PPM average and S / D average) is stored and recorded.
[0110] As a specific example, the status code parsing rules are as follows:
[0111] (1) 0xA01B: Return frame parsing successful;
[0112] (2) 0x0005: The serial port cable of the clock instrument is connected in reverse;
[0113] (3) 0xFFFF: The clock instrument did not receive clock data;
[0114] (4) 0xFF1F: The clock is being refreshed and the error value exceeds the limit.
[0115] 6. Assembly and sending of RTC adjustment frames
[0116] Based on the different automatic adjustment schemes selected by the user for the MCU chip configured for the measured electricity meter, different assembly and adjustment frame steps are performed: the obtained daily time error value is assembled in a specific algorithm format, and the total sum and check code are calculated and spliced into 645 protocol frames; the PC sends the frame through the COM port of the electricity meter, and the 645 protocol frame carrying the daily time adjustment offset value is written into the chip of the specified electricity meter.
[0117] Two or more automatic adjustment schemes are configured for different energy meter MCU types, including:
[0118] Solution 1: After assembling the S / D read from the daily time error value into a single-phase meter frame, directly send the frame to write the adjustment value;
[0119] Solution 2: After assembling the S / D read from the daily time error value into a three-phase meter frame, directly send a frame to write the adjustment value;
[0120] (3) Solution 3: Before adjustment, first send a frame in normal mode to turn off the RTC temperature compensation, then switch to the test compensation mode, add the PPM read from the daily time error value and the PPM read last time, and then send them in a frame. Then read the meter ADC value to obtain the meter's adjustment status, RTC compensation status and other information.
[0121] Solutions 1 and 2 above apply to the target adjustment object (electricity meter) with the HT6025 MCU. Electricity meters with the HT6025 MCU are further categorized as single-phase and three-phase meters, and the adjustment frame assembly methods for these two types differ, corresponding to Solutions 1 and 2, respectively. Solution 3 above applies to the target adjustment object with the FM33A048 MCU.
[0122] For the two different MCU chip models of electric energy meters mentioned above, the MCU chip performs adjustments in different ways based on the received adjustment frames:
[0123] Scheme 1 and Scheme 2 adopt the superposition writing adjustment mode: after obtaining the S / D from the currently received adjustment frame, it is necessary to superimpose it with the S / D written last time, and then write the superimposed S / D.
[0124] As a specific example, suppose the initial clock error is 1.25 S / D. The first trimming operation writes an error value of 1.25 S / D to the calibration register. After the trimming operation, the clock error value is read again, and the result is -0.2 S / D, indicating that the clock trim is too large. To store the ideal trim value in the calibration register, multiple trimming operations are required to correct the error. Therefore, a second trimming operation is required, with a value of -0.2 S / D written.
[0125] It should be noted that the superposition calibration register automatically performs a superposition operation when writing, that is, it automatically superimposes the previous 1.25 S / D in the register with the newly written -0.2 S / D, and writes the result 1.05 S / D into the electricity meter to adjust the clock error value of the electricity meter to 0 S / D.
[0126] The MCU in Solution 3 uses an overwrite adjustment mode: after obtaining the PPM from the currently received adjustment frame, it is directly written in an overwrite manner. That is, the PPM written this time is not superimposed on the PPM written previously, but the PPM obtained this time directly overwrites the previous adjustment result.
[0127] As a specific example, assuming the initial clock error is still 1.25 PPM, the first trimming operation writes an error value of 1.25 PPM to the calibration register. After the trimming operation, the clock error value is read again, and the reading result is still -0.2 PPM, indicating that the clock trim is too large. Similar to solutions one and two, the second round of trimming requires the register to store a trim value of 1.05 PPM. However, for calibration registers that overwrite, each write to the clock error overwrites the previous write. Therefore, the second trimming operation requires directly writing an error value of 1.05 PPM to adjust the meter's clock error to 0 S / D.
[0128] 7. Clock error check after adjustment
[0129] The allowable threshold for the adjusted daily time error is between ±0.01S / D; after the adjustment frame is sent, the daily time error needs to be read again and compared with the threshold range; if the adjusted daily time error is within the threshold, the clock error adjustment of the electricity meter at this temperature point is completed, the adjustment result value is rendered to the front-end page of the PC, and the relay of the clock signal relay is controlled to switch to the next target meter position for adjustment until the adjustment process of all selected meter positions is completed; if the adjusted daily time error is outside the threshold, the process of obtaining the daily time error and sending the RTC adjustment frame needs to be repeated (the maximum number of repetitions can be configured to be 8 times).
[0130] 8. Exception handling and logging
[0131] During the execution of automated adjustments by the PC-side software, an automatic retry mechanism will be activated (a maximum of five retries can be configured) in the event of no response from the serial port communication, failure in communication with the high and low temperature chamber, or if the daily timing adjustment is still out of tolerance. In addition, when an error occurs, an alarm prompt with different identifiers will be displayed on the front-end page based on the severity level. A detailed log of each operation (including timestamp, operation type, operation content, etc.) will be recorded. The log levels (global, information, warning, error, etc.) will be stored locally in the form of text documents. The daily log files will be automatically saved in different folders.
[0132] 9. Test report generation
[0133] After the automated tuning process is completed, a structured report can be generated based on the configuration.
[0134] As a specific example, the structured report includes:
[0135] (1) Error report before and after adjustment of 1-24 meter positions;
[0136] (2) Statistics of high and low temperature box execution time and corresponding temperature points;
[0137] (3) Single epitope PPM, S / D fluctuation curve, such as Figure 6 shown.
[0138] The energy meter clock error calibration system provided in this embodiment coordinates and controls the hardware equipment including high and low temperature chambers, energy meters, clock signal relays, and clock instruments based on the above-mentioned system software process, thereby achieving efficient, reliable, and fully automated adjustment of the high and low temperature daily timing error values of a large number of energy meters with different MCU models. This system not only significantly improves the efficiency, accuracy, and reliability of energy meter clock error testing and adjustment, but also enables flexible selection of multiple types of automatic adjustment schemes, such as different MCU chip models, normal temperature, and high and low temperature, to meet the application needs of different scenarios. Furthermore, the automation, intelligence, and data visualization of the adjustment process provide the energy meter manufacturing industry with an efficient, accurate, and reliable testing solution, which will help the industry upgrade to intelligent and automated directions.
[0139] Specifically, the electric energy meter clock error calibration system provided in this embodiment can bring the following effects:
[0140] 1. Test efficiency is significantly improved
[0141] Through the automated system software testing process, uninterrupted operation can be achieved around the clock, greatly reducing the long testing cycle caused by long waiting times for high and low temperature chambers and the inability of manual operation during non-working hours; meters can be tested in batches, shortening the adjustment cycle from several days to within a day; the PC-side software uniformly manages and dispatches the four devices of high and low temperature chambers, clock meters, clock signal relays, and electricity meters, reducing manual intervention, alleviating the workload of operators, and improving overall production efficiency.
[0142] 2. Test accuracy is greatly improved
[0143] The daily timing error value will fluctuate over a period of time. In the automatic adjustment process, the clock instrument uses one-minute readings of the daily timing error message multiple times (e.g., 8 times) to calculate the arithmetic average, and repeatedly adjusts the meter error by superposition. Through cumulative superposition, the written daily timing error is gradually fitted to the actual error value of the meter. A qualified threshold for the adjustment result is configured, and meters that still have errors exceeding the tolerance after multiple adjustments (e.g., 5 times) are recorded, effectively improving the test accuracy.
[0144] 3. Enhanced test reliability
[0145] Exception handling mechanisms (such as timeout retransmission and automatic error correction) reduce the test interruption rate to less than 1%. Exceptions that occur during testing are classified and handled according to severity. This reduces test failures caused by occasional errors, reducing hardware loss and time costs.
[0146] 4. Real-time data analysis and visualization
[0147] Calculate PPM and S / D values in real time and generate a daily timing error fluctuation curve over time, providing intuitive drawing results to help operators quickly and accurately locate problematic meters and make decisions; generate structured test reports (including key information such as meter position, meter number, meter temperature, high and low temperature chamber temperature, error before adjustment, error after adjustment, adjustment information, etc.), and support data tracing of historical logs; display the operating temperature of the high and low temperature chamber and the application connection status, the current set temperature of the high and low temperature chamber, and the execution time of the temperature point in real time, so as to quickly locate the current step of the adjustment task; render the seconds / day value of the error before adjustment and the error after adjustment of each electricity meter position in real time, so as to view the progress of the current adjustment process.
[0148] 5. Improved demand scalability
[0149] It supports multiple automatic adjustment schemes and can adopt different meter RTC adjustment frame assembly methods according to different MCU chips to meet the daily timing adjustment test of meters with various MCU chips; it supports two test modes: normal temperature and high and low temperature, and can selectively use high and low temperature chambers to meet the diverse needs of different adjustment scenarios.
[0150] 6. Reduced production costs
[0151] Automation reduces manpower requirements and improves testing efficiency; it reduces labor costs and reduces resource waste due to operational errors; it improves test accuracy and reliability, reduces after-sales repairs due to program defects, and enhances product competitiveness.
[0152] 7. Self-recovery capability in abnormal scenarios
[0153] When detecting abnormal conditions such as serial port communication timeout, disordered clock instrument return frame information, and clock instrument refresh causing daily timing errors to deviate from the normal range, the system will trigger a retry mechanism (such as setting a maximum retry count of 8 times) to avoid test failures caused by transient interference, improve test success rates, reduce manual intervention, and ensure the automation and continuity of the test process.
[0154] 8. Traceability of test results
[0155] Detailed logs are recorded for each operation (including timestamp, step type, operation content, etc.), with log levels (global, information, warning, error). After each automated adjustment process, the system automatically exports the project to Excel, monitors and records alarm information in real time, supports troubleshooting and problem location, and improves production process transparency. This provides data support for subsequent process optimization and promotes continuous improvement of product quality.
[0156] It is understood that the system software process described in this embodiment is implemented by executing the instructions on the PC (the host computer) and the related hardware (high-low temperature chamber, energy meter, clock signal relay, and clock instrument). The system software process can be stored in a computer-readable storage medium. When executed by the PC processor, this program can implement all the steps of the above process; after being executed by the PC processor, the system software process can also achieve the corresponding beneficial effects.
[0157] The storage medium may be a magnetic disk, an optical disc, a read-only memory (ROM) or a random access memory (RAM). Example 3
[0158] See also Figure 1 、 Figure 3 and Figure 6 This embodiment is based on the energy meter clock error calibration system described in the above embodiment (see Figure 1 ), provides a method for calibrating the clock error of an electric energy meter, combined with Figure 3 Understanding can include the following steps:
[0159] S1: Preset a control schedule for the high and low temperature chamber and at least two automatic adjustment schemes. The control schedule includes temperature points corresponding to at least three test cycles (corresponding to high, low, and normal temperature conditions, respectively) (each test cycle can include multiple temperature points), the operating time for each temperature point, and a meter number (specifically, the identifier of the energy meter being tested, which can be a meter location, such as the installation location of the energy meter in the test tooling, or a unique identifier, such as the energy meter number).
[0160] S2: The host computer executes the high and low temperature adjustment mode and adjusts the temperature of the high and low temperature box according to the control schedule;
[0161] It's understandable that this step defines the host computer's control of the temperature chamber during the entire testing and calibration process. Specifically, the host computer automatically generates a set of sequentially executed timer logic according to the control schedule. Each timer task corresponds to a temperature point and its run time. The logic loops through the following steps: adjusting the temperature of the temperature chamber, waiting for the temperature chamber to complete the specified run time, switching the connected energy meter, automatically adjusting the temperature, and verifying the adjustment results.
[0162] In some specific implementations, a normal temperature adjustment mode is also configured. Specifically including:
[0163] SS2: The host computer executes the normal temperature adjustment mode;
[0164] SS3: The host computer switches the connected meter number through the clock signal relay, reads the currently connected meter number and the temperature inside the meter, and obtains the daily time error message of the currently connected meter number through the clock instrument;
[0165] SS4: The host computer parses the received daily time error message to obtain the PPM and S / D data. It then calculates the average of all PPM and S / D data obtained in this round of testing to obtain the PPM average and S / D data average, and then obtains the clock error value composed of the two.
[0166] SS5: The host computer assembles frames according to the clock error value according to the automatic adjustment scheme selected for the currently connected meter number, obtains the RTC adjustment frame, and sends it to the corresponding measured energy meter;
[0167] SS6: The host computer verifies the RTC adjustment result of the measured electric energy meter that receives the RTC adjustment frame until the RTC adjustment result meets the requirements or the RTC adjustment times are reached.
[0168] Here, the above-mentioned SS2 step can be located after the S1 step, by judging whether the control schedule of the high and low temperature box is checked. If not, the SS2 step is automatically triggered to execute the normal temperature adjustment mode; it can also be independent of the S1 step, before the S1 step, or after the S1 step and before the S2 step, the user triggers the SS2 step on the host computer to execute the normal temperature adjustment mode.
[0169] The setting of the normal temperature adjustment mode, together with the high and low temperature adjustment mode, provides users with two test mode options. Users can selectively use the high and low temperature chambers according to their needs to meet the diverse needs of different adjustment scenarios.
[0170] S3: The host computer switches the connected meter number through the clock signal relay in each round of testing, obtains the currently connected meter number, and obtains the daily timing error message of the currently connected meter number in each round of testing through the clock instrument.
[0171] It can be understood that this step defines the control of the host computer's connection to different energy meters under test via clock signal relays throughout the entire testing and calibration process. Specifically, the host computer will control the clock signal relays to switch to the designated energy meter under test at a specified time according to the logic of each timer task, to perform daily time error testing and calibration on it. This automatically switches connections to different energy meters under test at the specified time, fully automatically performing daily time error testing and calibration on each target energy meter under test.
[0172] In some specific embodiments, the step S3 specifically includes:
[0173] S31: Determine whether all selected table numbers have been traversed in this round of testing. If so, return to S2 and switch to the next round of testing; if not, execute S32;
[0174] S32: The host computer switches the connected meter number through the clock signal relay, reads the currently connected meter number and the temperature inside the meter, and obtains the daily timing error message of the currently connected meter number in this round of testing through the clock meter.
[0175] Through the above judgment, it can be ensured that each watch number selected in each round of testing completes the clock error testing and adjustment to avoid omissions.
[0176] In some specific implementations, during the operating time of each temperature point, daily time error messages are obtained multiple times to effectively avoid possible deviations and ensure the accuracy of subsequent calculations of the daily time error corresponding to each temperature point.
[0177] S4: The host computer parses the received daily time error message, obtains PPM and S / D data, and associates and stores them with the currently connected meter number.
[0178] It can be understood that this step defines the way in which the host computer parses and processes the acquired daily time error message during the entire test and calibration process.
[0179] S5: The host computer calculates the mean of all PPM and S / D data obtained for each meter number in each round of testing, and obtains a clock error value including the PPM mean and the S / D mean.
[0180] It's understood that this step specifies that the host computer determines the clock error value for each meter number in each test round during the entire test and calibration process. In actual implementation, the clock error value for each test round will be determined using the above method for each timer task, rather than obtaining the clock error value for each test round after all test rounds have completed.
[0181] In this embodiment, one test cycle corresponds to a temperature scenario. For example, three temperature scenarios, high temperature, normal temperature, and low temperature, are configured in the control schedule of the high and low temperature chamber. This step calculates the clock error value corresponding to each test cycle.
[0182] S6: After each round of testing, the host computer assembles frames according to the clock error value corresponding to each meter number according to the automatic adjustment scheme selected for each meter number in this round of testing, obtains the RTC adjustment frame and sends it to the corresponding measured electric energy meter.
[0183] It should be understood that this step defines the automatic adjustment method for all meter numbers in each test round during the entire test and calibration process. In actual execution, each timer task will complete the automatic adjustment of all meter numbers in the current test round before proceeding to the next timer task, i.e., the next test round.
[0184] In some specific implementations, the automatic adjustment schemes configured according to the MCU chip types of different energy meters mainly include the following three:
[0185] The first automatic adjustment scheme includes: obtaining the S / D mean value based on the clock error value corresponding to the meter number in the current test round, assembling it according to the single-phase meter frame format, and adding its total sum verification code to splice it to obtain the RTC adjustment frame;
[0186] The second automatic adjustment scheme includes: obtaining the S / D mean value based on the clock error value corresponding to the meter number in this round of testing, assembling it according to the three-phase meter frame format, and adding its total sum verification code to splice it to obtain the RTC adjustment frame;
[0187] Optionally, the S / D mean values obtained in the first automatic adjustment scheme and the second automatic adjustment scheme are converted into hexadecimal bytes and then assembled.
[0188] The third automatic adjustment scheme includes: turning off RTC temperature compensation, obtaining the PPM mean value based on the clock error value corresponding to the meter number in this round of testing, adding and accumulating it with the PPM mean value in the previous round of testing, and assembling it, adding the total sum verification code, and reading the current ADC value of the meter number at the same time to obtain the RTC adjustment frame.
[0189] As a specific example, Solutions 1 and 2 above apply to the target adjustment target (electricity meter) using the HT6025 MCU. Electricity meters using the HT6025 MCU are further categorized into single-phase and three-phase meters, and the two types of meters have different adjustment frame assembly methods, corresponding to Solutions 1 and 2, respectively. Electricity meters using this MCU don't have the three adjustment modes described below, so when writing adjustment values, the overlay mode is used instead of the overwrite mode used in Solution 3. This means that the meter doesn't need to shield itself from the daily timekeeping offset caused by adjustments at room temperature. Accurate adjustment can be achieved by simply writing the clock error value at the current temperature and adding it to the existing register error value, without the need for mode switching.
[0190] As a specific example, Solution 3 above applies to a target calibration target with the FM33A048 MCU. Because this MCU chip is used in an energy meter, the calibration process is divided into three modes: normal mode (i.e., normal temperature calibration mode), test compensation mode (i.e., high and low temperature calibration mode), and meter reading mode.
[0191] In normal mode, the multi-temperature calibration register is closed, and the energy meter can only write the adjustment value at room temperature. After writing the adjustment value, the clock error data read by the clock meter is the error after the adjustment is completed at room temperature.
[0192] In test compensation mode, calibration registers at multiple temperature points are open. When writing an adjustment value, the meter writes the adjustment value to the register closest to the temperature point based on the ambient temperature. In other words, only when test compensation mode is enabled can the meter perform adjustments at multiple temperature points and perform multi-point calibration on the adjusted daily time error curve.
[0193] In the meter reading mode, the adjustment status of the electric energy meter test in the previous step can be checked, and the read temperature ACD value and the daily time error data of multiple temperature points can be fitted into a quadratic curve with the horizontal and vertical coordinates respectively and then rewritten into the electric energy meter, thereby completing the adjustment more accurately.
[0194] Therefore, for the target FM33A048 MCU, after entering the high and low temperature trim mode, the effects of the normal temperature trim mode must be disabled to ensure accurate trim results. Therefore, the automatic trimming solution for this MCU requires disabling RTC temperature compensation and performing a mode switch before automatic trimming. This removes the trim values written to the normal temperature calibration registers in the normal temperature mode, allowing the clock to read the meter's true daily timekeeping error.
[0195] Specifically, the two energy meters with different MCU chip models described in the two specific examples above have different ways of performing adjustments based on the received adjustment frames, depending on the type of MCU chip:
[0196] Solutions 1 and 2 use an overlay write mode for trimming: After obtaining the S / D from the currently received trimming frame, it is superimposed with the previously written S / D and the resulting S / D is written. The overlay calibration register automatically performs an overlay operation when writing, automatically superimposing the previous S / D in the register with the newly written S / D, and then writing the resulting S / D to the energy meter, thereby trimming the meter's clock error to 0 S / D.
[0197] The MCU in Solution 3 uses an overwrite trimming mode: after obtaining the PPM from the currently received trimming frame, it is directly written over it. This means that the PPM written this time is not added to the previously written PPM. Instead, the newly acquired PPM directly overwrites the previous trimming result. For calibration registers that are overwritten, each write to the clock error overwrites the previously written clock error. Therefore, the second trimming operation requires directly writing the resulting error value to trim the meter's clock error to 0 S / D.
[0198] S7: The host computer verifies the RTC adjustment result of the measured electric energy meter that receives the RTC adjustment frame until the RTC adjustment result meets the requirement or the RTC adjustment times are reached.
[0199] It's understood that this step defines the verification of the adjustment results for all meter numbers in each test round during the entire testing and calibration process. In actual execution, each timer task will complete the adjustment verification for all meter numbers in the current test round before proceeding to the next timer task, i.e., the next test round.
[0200] In some specific implementations, the process of the host computer verifying the RTC adjustment result of the tested electric energy meter includes:
[0201] The upper computer re-acquires the daily timing error message of the meter number and parses and calculates the corresponding clock error value; if the clock error value is within the error threshold, the adjustment of the corresponding tested electric energy meter in this round of testing is completed; if the clock error value is outside the error threshold, it returns to execute steps S3 to S7, that is, repeats the automatic RTC adjustment until the adjustment result meets the daily timing error qualified threshold range or reaches the preset maximum number of repeated adjustments.
[0202] It should be noted that during the repeated automatic RTC trimming process, that is, during the cyclic execution of steps S3 to S7, the final clock error value in each assembled RTC trimming frame will vary depending on the selected automatic trimming scheme.
[0203] (1) For solutions 1 and 2, the clock meter data will be re-read and the latest error value will be used to compose the frame for overwriting and adjustment. That is, the final clock error value in each assembled RTC adjustment frame is the latest error value obtained and determined;
[0204] (2) Corresponding to solution 3, after re-reading the clock instrument data, the final clock error value of this round of testing is added to the final clock error value used in the previous round of framing, and the error value after the accumulation result is framed and sent.
[0205] S8: The host computer generates a real-time rendering of the PPM and S / D data corresponding to each measured electric energy meter over time, and displays the fluctuation curve on the front-end display screen interface. The display effect of the front-end display screen interface is as follows: Figure 6 shown.
[0206] Here, PP and S / D values are calculated in real time and a daily timing error fluctuation curve is generated over time, providing intuitive plotting results to help operators quickly locate problematic meters and facilitate quick decision-making.
[0207] S9: After executing the high and low temperature adjustment mode, the host computer generates a corresponding structured report, which includes an error report before and after adjustment for each table number, a high and low temperature box execution time and its corresponding temperature statistics table, and the fluctuation curve diagram.
[0208] Here, structured reports that record key information can provide users with data tracing functions of historical logs.
[0209] Steps S8 and S9 of this embodiment realize data visualization of the test process, which helps to grasp the test situation in real time and realize the traceability of the test results. Example 4
[0210] Please refer to Figures 1 to 7 This embodiment further refines and expands upon the above-mentioned embodiment 3, and provides a test and calibration process for the clock error of the energy meter, combined with Figure 3 To understand, the following steps are involved:
[0211] Step 1: Communication parameter input
[0212] (1) After the PC host system is started, it automatically scans for available COM ports.
[0213] (2) The operator inputs the control schedule of the high and low temperature chamber and configures the COM port and baud rate of four hardware devices (high and low temperature chamber, clock, clock signal relay and multiple measured electric energy meters).
[0214] (3) Select 1-24 meters on the front-end page of the PC host computer. The selected meters will enter the automated test process. Here, 24 meters are an example. The specific number is not limited to this and depends on the number of clock signal terminals configured by the clock signal relay.
[0215] Step 2: Initialize the automated testing process
[0216] (1) According to the configuration of the operator (whether the control schedule of the high and low temperature box is configured), it is decided to execute the normal temperature test mode or the high and low temperature box test mode.
[0217] (2) The host computer system on the PC automatically generates a multi-step timer, and coordinates the communication of the four devices according to the control schedule planning task. Through the delay between the timers, the temperature inside the electricity meter is made close to the ambient temperature of the high and low temperature box in this round of adjustment, thereby achieving multi-temperature point adjustment.
[0218] like Figure 7 The figure shows the front-end configuration interface of the PC host computer in a specific example.
[0219] Step 3: Adjust the high and low temperature box
[0220] (1) The PC host computer communicates with the high and low temperature box to adjust the operating temperature of the high and low temperature box;
[0221] (2) After the temperature adjustment is completed, the timer task is delayed to allow the temperature inside the measured electric energy meter to gradually stabilize to the ambient temperature inside the high and low temperature box;
[0222] (3) The PC host computer records the corresponding relationship between the operating temperature of the high and low temperature box and time in real time and records it in the MySQL database.
[0223] Step 4: Clock Signal Relay Switching
[0224] When the delay time of the timer task ends, the temperature inside the meter has stabilized and can be adjusted; the PC host computer sends a frame to the clock signal relay and switches the selected meter position list in a cyclic order.
[0225] Step 5: Sending and receiving the energy meter 698 protocol request frame
[0226] (1) The PC host computer communicates with the electric energy meter at the specified position and requests the meter number and internal temperature of the electric energy meter by sending a 698 protocol request frame;
[0227] (2) The PC host computer parses the return frame of the energy meter, performs CRC check on the return frame message and compares the HCS and FCS check codes; after the check is successful, it parses the data in the ADPU part of the message to obtain the meter number and current temperature information of the energy meter.
[0228] Step 6: Obtaining the daily timing error data of the clock instrument
[0229] (1) The PC host computer communicates with the clock instrument through the serial port and sends frames (the frame message format is as follows Figure 4 As shown) request to obtain the daily time error value of the current table position, and respond to the frame (the received frame message format is as follows Figure 5 Calculate PPM and S / D, i.e. clock error value, by analyzing the data shown in the figure.
[0230] (2) Make a legal judgment on the obtained clock error value. If it is in the clock instrument refresh period or the return frame is disordered, filter the error of this round of reading, and calculate the average of PPM and S / D respectively after cyclic reading 8 times (or other set times). The corresponding average value is used as the reading result, that is, the final clock error value.
[0231] (3) The front-end web page of the PC host computer renders in real time to generate the fluctuation curve of PPM and S / D over time. Figure 6 Shown is the real-time curve rendering effect.
[0232] Step 7: Assembling and sending the RTC adjustment frame
[0233] According to the automatic adjustment scheme pre-selected by the operator, different frame transmission modes are adopted to perform RTC adjustment.
[0234] (1) Schemes 1 and 2: Use the 645 protocol for framing and sending, specifically framing the S / D in the clock error value before sending.
[0235] (2) Option 2: Use the 645 protocol for framing and sending. Specifically, it is necessary to first set the meter to normal test mode, read the ADC value to obtain the calibration information, then set the meter to test mode, and frame the PPM in the obtained clock error value before sending it.
[0236] Step 8: Check the clock error after adjustment
[0237] After the RTC trimming is completed, it is necessary to repeat step 6 to obtain the clock instrument daily timing error data to verify whether the error of the trimming result is within 0.01S / D. If not, it is necessary to repeat step 7 to assemble and send the RTC trimming frame until the trimming result meets the daily timing error qualified threshold range or the trimming is repeated 5 times (or other preset limits) without success.
[0238] It should be noted that when the energy meter repeats the adjustment process, the daily time error data used to assemble the RTC adjustment frame will vary depending on the selected automatic adjustment scheme:
[0239] (1) Option 1 and 2: Re-read the clock data and use the latest error value to frame and overwrite and adjust.
[0240] (2) Option 3: Read the clock data, add the error data of this round to the error data used in the previous round of framing, and frame the error value after the accumulation to send.
[0241] Step 9: Finalize the automated testing process
[0242] (1) After all the target measured electric energy meters have completed the timing tasks generated by the control schedule of the high and low temperature box, the high and low temperature box is controlled to stop running;
[0243] (2) Automatically generate a test report and export it to an Excel file in a local folder on the PC.
[0244] Experimental comparisons show that the electricity meter clock error testing and calibration process provided in this embodiment has the following outstanding effects compared to the traditional high and low temperature clock error testing method:
[0245] (1) Efficiency comparison: Traditional manual testing of 24 stations takes 2-3 days, while the fully automated adjustment provided in this embodiment can be completed within 12 hours.
[0246] (2) False positive rate: It can be reduced from 5% of traditional methods to below 0.1%.
[0247] (3) Hardware compatibility: Able to support a variety of mainstream meter chip models.
[0248] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A system for calibrating an electric energy meter clock error, characterized in that: include: Host computer, high and low temperature chamber, clock instrument, clock signal relay and multiple electric energy meters under test; The host computer is respectively connected to the high and low temperature box, the clock instrument, the clock signal relay and the plurality of electric energy meters under test; the clock instrument is also connected to the clock signal relay; the clock signal relay is also respectively connected to the clock signal terminals of the plurality of electric energy meters under test; the plurality of electric energy meters under test are placed in the high and low temperature box; The host computer is configured to preset a control schedule for the high and low temperature chambers and at least two automatic adjustment schemes, wherein the control schedule includes temperature points corresponding to at least three rounds of tests and their operating times and table numbers; and When executing the high and low temperature adjustment mode, adjusting the temperature of the high and low temperature box according to the control schedule; and In each round of testing, the clock signal relay switches the connected meter number, obtains the currently connected meter number, and obtains the daily timing error message of the currently connected meter number in each round of testing through the clock instrument; and Parse the received daily time error message, obtain PPM and S / D data, and store them in association with the currently connected meter number; and Calculate the average of all PPM and S / D data obtained in each round of testing for each meter number to obtain a clock error value including the PPM average and the S / D average; and After each round of testing, according to the automatic adjustment scheme selected for each meter number, the RTC adjustment frame is assembled from the clock error values corresponding to each meter number and sent to the corresponding electric energy meter under test; and Verifying the RTC adjustment result of the electric energy meter under test that receives the RTC adjustment frame until the RTC adjustment result meets the requirements or the RTC adjustment times are reached; The at least two automatic adjustment schemes correspond to different types of electric energy meter MCUs, including: The first automatic adjustment scheme includes: obtaining the S / D mean value based on the clock error value corresponding to the meter number in the current test round, assembling it according to the single-phase meter frame format, and adding its total sum verification code to splice it to obtain the RTC adjustment frame; The second automatic adjustment scheme includes: obtaining the S / D mean value based on the clock error value corresponding to the meter number in this round of testing, assembling it according to the three-phase meter frame format, and adding its total sum verification code to splice it to obtain the RTC adjustment frame; The third automatic adjustment scheme includes: turning off RTC temperature compensation, obtaining the PPM mean value based on the clock error value corresponding to the meter number in this round of testing, adding and accumulating it with the PPM mean value in the previous round of testing, and assembling it, adding the total sum verification code, and reading the current ADC value of the meter number at the same time to obtain the RTC adjustment frame.
2. The electric energy meter clock error calibration system according to claim 1, characterized in that: The host computer is connected to the high and low temperature box, the clock instrument, the clock signal relay and a plurality of measured electric energy meters through serial ports respectively.
3. The electric energy meter clock error calibration system according to claim 1, characterized in that: The clock signal relay includes a single chip microcomputer, a first resistor, a second resistor, a third resistor, a transistor, a light emitting diode, a freewheeling diode and a relay; The control pin of the single-chip microcomputer is connected to the base of the transistor through a first resistor; the ground pin of the single-chip microcomputer is connected to the base of the transistor through a second resistor, and is directly connected to the emitter of the transistor; the VCC pin of the single-chip microcomputer is divided into three paths, one path is connected to the collector of the transistor via a third resistor and a light-emitting diode in sequence, one path is connected to the collector of the transistor via a freewheeling diode, and one path is connected to the collector of the transistor via an input circuit of a relay; the common end in the output circuit of the relay is connected to the clock pulse end of the electric energy meter under test, and the normally open end is connected to the clock instrument.
4. A method for calibrating an electric energy meter clock error, characterized in that: The system is implemented based on the electric energy meter clock error calibration system according to any one of claims 1 to 3, and includes: S1: Preset a control schedule for the high and low temperature chamber and at least two automatic adjustment schemes, wherein the control schedule includes the temperature points corresponding to at least three rounds of tests and their operating times and table numbers; S2: The host computer executes the high and low temperature adjustment mode and adjusts the temperature of the high and low temperature box according to the control schedule; S3: The host computer switches the connected meter number through the clock signal relay in each round of testing, obtains the currently connected meter number, and obtains the daily timing error message of the currently connected meter number in each round of testing through the clock instrument; S4: The host computer parses the received daily time error message, obtains PPM and S / D data, and associates and stores them with the currently connected meter number; S5: The host computer calculates the mean of all PPM and S / D data obtained in each round of testing for each meter number, and obtains the clock error value including the PPM mean and the S / D mean; S6: After each round of testing, the host computer assembles an RTC adjustment frame from the clock error values corresponding to each meter number according to the automatic adjustment scheme selected for each meter number and sends it to the corresponding measured energy meter; S7: The host computer verifies the RTC adjustment result of the electric energy meter under test that receives the RTC adjustment frame until the RTC adjustment result meets the requirements or the RTC adjustment times are reached; The at least two automatic adjustment schemes correspond to different types of electric energy meter MCUs, including: The first automatic adjustment scheme includes: obtaining the S / D mean value based on the clock error value corresponding to the meter number in the current test round, assembling it according to the single-phase meter frame format, and adding its total sum verification code to splice it to obtain the RTC adjustment frame; The second automatic adjustment scheme includes: obtaining the S / D mean value based on the clock error value corresponding to the meter number in this round of testing, assembling it according to the three-phase meter frame format, and adding its total sum verification code to splice it to obtain the RTC adjustment frame; The third automatic adjustment scheme includes: turning off RTC temperature compensation, obtaining the PPM mean value based on the clock error value corresponding to the meter number in this round of testing, adding and accumulating it with the PPM mean value in the previous round of testing, and assembling it, adding the total sum verification code, and reading the current ADC value of the meter number at the same time to obtain the RTC adjustment frame.
5. The method for calibrating the clock error of an electric energy meter according to claim 4, wherein: Said S7 specifically includes: The host computer once again obtains the clock error value of the meter number; if the clock error value is within the error threshold, the adjustment of the corresponding tested electric energy meter in this round of testing is completed; if the clock error value is outside the error threshold, it returns to execute step S3 until the RTC adjustment result meets the requirements or the RTC adjustment times are reached.
6. The method for calibrating an electric energy meter clock error according to claim 4, wherein: Said S3 specifically includes: S31: In this round of testing, have all selected table numbers been traversed? If so, return to S2 and switch to the next round of testing; if not, execute S32; S32: The host computer switches the connected meter number through the clock signal relay, reads the currently connected meter number and the temperature inside the meter, and obtains all daily timing error messages of the currently connected meter number in this round of testing through the clock meter.
7. The method for calibrating an electric energy meter clock error according to claim 4, wherein: Also includes: SS2: The host computer executes the normal temperature adjustment mode; SS3: The host computer switches the connected meter number through the clock signal relay, reads the currently connected meter number and the temperature inside the meter, and obtains the daily time error message of the currently connected meter number through the clock instrument; SS4: The host computer parses the received daily time error message, obtains PPM and S / D data, and obtains a clock error value including the PPM and S / D data; SS5: The host computer assembles an RTC adjustment frame from the clock error value according to the automatic adjustment scheme selected for the currently connected meter number and sends it to the corresponding measured energy meter; SS6: The host computer verifies the RTC adjustment result of the measured electric energy meter that receives the RTC adjustment frame until the RTC adjustment result meets the requirements or the RTC adjustment times are reached.
8. The method for calibrating an electric energy meter clock error according to claim 4, wherein: Also includes: S8: The host computer generates a fluctuation curve diagram of the PPM and S / D data corresponding to each measured electric energy meter with respect to time by rendering in real time, and displays the fluctuation curve diagram.
9. The method for calibrating an electric energy meter clock error according to claim 8, wherein: Also includes: S9: After executing the high and low temperature adjustment mode, the host computer generates a corresponding structured report, which includes an error report before and after adjustment for each table number, a high and low temperature box execution time and its corresponding temperature statistics table, and the fluctuation curve diagram.
Citation Information
Patent Citations
Multi-meter parallel daily timing automatic adjusting device of intelligent electric energy meter
CN113325685A
Electric energy meter calibration method, calibration system and electric energy meter
CN119738771A