Method and system for detecting precision of voltage sensor and storage medium
By using a closed-loop measurement and control system and Kalman averaging dual filtering technology, the problems of accuracy calibration and data traceability of multi-channel voltage sensors were solved, enabling rapid and accurate voltage sensor accuracy detection and improving detection efficiency and data reliability.
Patent Information
- Application Number
- CN202511352291.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-09-22
AI Technical Summary
Existing technologies have failed to effectively solve the problems of accuracy calibration of multi-channel voltage sensors and encrypted traceability of data throughout the process. In particular, in deeply integrated circuit breakers, the accuracy deviation measurement of voltage acquisition boxes and voltage transformers is not fast and accurate enough.
A closed-loop measurement and control system is adopted, including a withstand voltage tester, a calibration instrument, a relay control board, and computer-based automatic testing software. The system uses an instantaneous curvature algorithm to determine the stable phase, and combines Kalman and moving average dual filtering to calculate the ratio difference and angle difference. The MD5 check value is used to ensure data integrity, thereby achieving fast and accurate voltage sensor precision detection.
It enables automated, traceable, and accurate testing of multi-channel voltage sensors, significantly shortening testing time, improving data reliability and production efficiency, and ensuring the accuracy and reliability of test results.
Smart Images

Figure CN121069290A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of precision detection, and in particular to a method and system for detecting precision of a voltage sensor and a storage medium. BACKGROUND
[0002] The internal components of the deep fusion circuit breaker include arc extinguishing switches, voltage sensors, current sensors, spring operating mechanisms, and other parts; the voltage signal is collected by a voltage collection box and a voltage sensor; due to the existence of certain errors in actual hardware, the voltage collection quantity requires high precision; therefore, the matching sensor needs to be calibrated on the voltage collection box to make the voltage collection precision reach the 0.5S level; a method is needed to quickly measure the precision deviation of the voltage collection box and the voltage transformer.
[0003] A similar prior art is a Chinese patent application with the publication number CN109143145A, which provides an alternating current withstand voltage detection system suitable for smart electric energy meters and electric energy information collection terminals, including an industrial computer, an alternating current withstand voltage tester, and an alternating current withstand voltage test bench body. The industrial computer is connected to the control end of the alternating current withstand voltage tester, and controls the alternating current withstand voltage tester to generate different levels of voltage output according to different withstand voltage detection schemes. The industrial computer is connected to the control end of the alternating current withstand voltage test bench body, and controls the compression and release of different positions of the alternating current withstand voltage test bench body and the opening and closing of the high-voltage relay. The alternating current withstand voltage tester is connected to the alternating current withstand voltage test bench body, and outputs different levels of voltage to the alternating current withstand voltage test bench body. The alternating current withstand voltage test bench body includes four detection stations and four sets of high-voltage relay switching units corresponding to the four detection stations.
[0004] A similar prior art is a Chinese patent application with the publication number CN107064853A, which provides an electric energy meter withstand voltage test system and method with automatic test voltage switching function, including an alternating current voltage tester with multiple voltage output ends for outputting different voltages. Each voltage output end of the alternating current voltage tester corresponds to one relay, and each relay has a control input end and a control output end. Each control output end includes a common end and an output connection end. The output connection end of each relay is connected to one voltage output end of the alternating current voltage tester. All common ends of the relays are connected to form a test voltage output end connected to the electric energy meter to be tested. The control input end of each relay is connected to a controller. During testing, the controller controls one of the relays to be in a conducting state, and the other relays are in a disconnected state, thereby realizing the selection of the test voltage and loading the selected test voltage to the electric energy meter to be tested for withstand voltage capability testing.
[0005] However, the above two technical solutions only focus on the voltage switching and insulation strength of single power meter voltage withstand test, and do not involve multi-channel precision calibration and whole process data encryption traceability, therefore, the application provides a method and system for detecting the precision of a voltage sensor and a storage medium. SUMMARY
[0006] The application provides a method and system for detecting the precision of a voltage sensor and a storage medium for quickly and accurately detecting the precision of a voltage sensor.
[0007] In a first aspect, the application provides a method for detecting the precision of a voltage sensor, the method comprising: The computer-side automatic test software sends a handshake frame to the withstand voltage instrument, the calibration instrument, and the relay control board, and if a correct response is obtained within a predetermined time, it is determined that the communication link is normal, otherwise the test is terminated and a communication failure code is prompted; Based on the preset pole number, voltage value test point and precision threshold, a test script is generated, and each voltage value test point of each pole is tested based on the test script, including: the relay control board closes the pole line according to the test order, controls the calibration instrument to collect sequence data of the pole at a preset sampling frequency, and based on the sequence data, determines that the stable stage is reached, and the calibration instrument collects stable sequence data at a predetermined sampling frequency, and based on the stable sequence data and Kalman plus moving average double filtering, the amplitude mean and phase are obtained, and the withstand voltage instrument outputs the standard voltage corresponding to the voltage value test point; Based on the standard voltage, amplitude mean and phase, the ratio difference and angle difference are calculated, and for each voltage value test point, the pole number, test point percentage, standard voltage, measured voltage, ratio difference, angle difference, qualified state, test time stamp and MD5 check value of the voltage value test point are generated into a test record and saved; After all voltage value test points of all poles are completed, a plurality of ratio differences and angle differences are obtained, the maximum ratio difference and the maximum angle difference are obtained, the maximum ratio difference is compared with the preset first precision threshold, the maximum angle difference is compared with the preset second precision threshold, and based on the comparison result, it is judged whether the voltage sensor precision is qualified.
[0008] In combination with the first aspect, in a first implementation manner of the first aspect of the application, the closed-loop measurement and control system is connected based on the following manner: The high-voltage output end of the withstand voltage instrument is connected to the common input end of the relay control board, each output end of the relay control board is respectively connected to the primary side of the corresponding pole, the secondary side small signal output end of each pole is connected to the multi-channel input end of the calibration instrument, and the withstand voltage instrument and the calibration instrument are respectively connected to the computer-side automatic test software through RS232 to establish a bidirectional communication connection, and the relay control board is connected to the computer-side automatic test software through Ethernet to establish a bidirectional communication connection.
[0009] In a second implementation form of the first aspect, based on the sequence data, it is determined that the stable stage is reached, including: The real-time sampling data of the last sampling period of the calibration instrument is read, a complex vector is obtained by taking the fundamental component after discrete Fourier transform of the real-time sampling data, each time a new sampling data is obtained, the earliest sampling data is deleted, the new sampling data is added, and a new complex vector is obtained by performing discrete Fourier transform again and taking the fundamental component, the instantaneous curvature of each sampling data is calculated based on the complex vector, the instantaneous curvature of each sampling data in two continuous periods is continuously calculated, and if the instantaneous curvatures in the two continuous periods are both less than a preset threshold, it is determined that the stable stage is reached.
[0010] In a third implementation form of the first aspect, the instantaneous curvature of each sampling data is calculated based on the complex vector, including: For the i th sampling data, the previous sampling data and the next sampling data of the i th sampling data are obtained, the complex vectors corresponding to the three adjacent sampling data are Z i-1 , Z i and Z i+1 , a first vector X = Z i -Z i-1 is calculated, a second vector Y = Z i+1 -Z i is calculated, and the instantaneous curvature k i corresponding to the i th sampling data is calculated based on the first vector and the second vector, and the calculation formula is Wherein, lm represents the imaginary part of the complex number.
[0011] In a fourth implementation form of the first aspect, the amplitude mean value and the phase are obtained based on the stable sequence data and the Kalman plus moving average double filtering, including: One sampling period is taken as a sliding window, and one sampling data is taken as a step, the stable sequence data in the corresponding sliding window is executed discrete Fourier transform to obtain the fundamental complex vector corresponding to each period each time the sliding window is slid, and the amplitude and the phase corresponding to each period are obtained based on the fundamental complex vector; The amplitudes of the multiple periods form an amplitude sequence, and the amplitude sequence is processed by Kalman plus moving average double filtering to obtain the amplitude mean value corresponding to each period.
[0012] In a fifth implementation form of the first aspect, the amplitude sequence is processed by Kalman plus moving average double filtering to obtain the amplitude mean value, including: The state vector is set as an amplitude sequence, the process noise covariance is configured according to prior thermal noise statistics, the observation noise covariance is estimated in real time through the no-load calibration stage, and the Kalman filter performs prior estimation, prior covariance calculation, Kalman gain calculation, posterior estimation and posterior covariance calculation once in each sampling interval to output real-time optimal estimation at each time, all optimal estimations form an optimal estimation sequence, the optimal estimation sequence is input into a sliding average filter with a preset length, the coefficient of the sliding average filter is determined based on the equal-weight average measurement of the optimal estimations in the window, and the final amplitude mean value is obtained by summing and averaging all outputs of the sliding average filter.
[0013] In combination with the first aspect, in a sixth implementation manner of the first aspect of the application, the ratio difference and the angle difference are calculated based on the standard voltage, the amplitude mean value and the phase, including: A sampling period corresponding to the amplitude mean value is obtained, a standard voltage corresponding to the sampling period of the withstand voltage instrument is obtained, a standard amplitude and a standard phase are obtained by performing discrete Fourier transform on the standard voltage, a first difference value is obtained by subtracting the amplitude mean value from the standard amplitude and taking an absolute value, and a ratio difference is obtained by dividing the first difference value by the standard amplitude. A phase corresponding to the amplitude mean value is obtained and referred to as a measured phase, and an angle difference is obtained by subtracting the measured phase from the standard phase and taking an absolute value.
[0014] In combination with the first aspect, in a seventh implementation manner of the first aspect of the application, whether the sensor precision is qualified is judged based on the comparison result, including: If the maximum ratio difference is less than a first precision threshold and the maximum angle difference is less than a second precision threshold, it is judged that the sensor precision is qualified, otherwise it is judged that the sensor precision is unqualified.
[0015] Secondly, the application provides a system for detecting the precision of a voltage sensor, including: A communication establishment module, the computer terminal automatic test software sends a handshake frame to the withstand voltage instrument, the calibration instrument and the relay control board, if a correct response is obtained within a predetermined time, it is determined that the communication link is normal, otherwise the test is terminated and a communication failure code is prompted; A data processing module, a test script is generated based on a preset pole number, a voltage value test point and a precision threshold, each voltage value test point of each pole is tested based on the test script, including: the relay control board closes the pole line according to the test order, the calibration instrument collects sequence data of the pole at a preset sampling frequency, after it is determined that the stable stage is reached based on the sequence data, the calibration instrument collects stable sequence data at a predetermined sampling frequency, the amplitude mean value and the phase are obtained based on the stable sequence data and the Kalman plus sliding average double filtering, and the standard voltage of the corresponding voltage value test point is output by the withstand voltage instrument; The data storage module calculates the ratio difference and the angle difference based on the standard voltage, the amplitude mean value and the phase, generates a test record of the pole number, the test point percentage, the standard voltage, the measured voltage, the ratio difference, the angle difference, the qualified state, the test time stamp and the MD5 check value of the voltage test point after each voltage test point is tested, and saves the test record; The precision judgment module obtains a plurality of ratio differences and angle differences after all voltage test points of all poles are completed, obtains the maximum ratio difference and the maximum angle difference, compares the maximum ratio difference with the first preset precision threshold value, compares the maximum angle difference with the second preset precision threshold value, and judges whether the voltage sensor precision is qualified based on the comparison results.
[0016] The third aspect of the present application provides a computer readable storage medium, the computer readable storage medium has instructions stored therein, when the instructions are executed on a computer, the computer executes the above-mentioned detection method for voltage sensor precision.
[0017] Compared with the prior art, the present application has at least the following advantages: In the technical solution provided by the present application, the closed-loop measurement and control system composed of the voltage-withstanding instrument, the calibration instrument, the relay control board and the computer terminal automatic test software completes the automatic and traceable precision detection of all voltage test points of all poles at one time, dynamically judges stability by using the instantaneous curvature algorithm, improves the amplitude estimation precision by using Kalman filtering and sliding average filtering, and determines the overall qualification by the maximum ratio difference and the maximum angle difference at one time, which significantly shortens the test time, improves the data reliability and production efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor based on these drawings.
[0019] Figure 1 An embodiment schematic diagram of the detection method for voltage sensor precision in the embodiment of the present application; Figure 2 A connection mode schematic diagram of the closed-loop measurement and control system in the embodiment of the present application; Figure 3 An embodiment schematic diagram of the detection system for voltage sensor precision in the embodiment of the present application. DETAILED DESCRIPTION
[0020] The embodiments of the present application provide a method and system for detecting the precision of a voltage sensor and a storage medium. The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the term "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0021] For ease of understanding, the specific process of the embodiments of the present application is described below. Please refer to Figure 1 One embodiment of the method for detecting the precision of a voltage sensor in the embodiments of the present application comprises the following steps. Step S1, the computer terminal automatic test software sends a handshake frame to the withstand voltage instrument, the calibration instrument and the relay control board. If a correct response is obtained within a predetermined time, it is determined that the communication link is normal, otherwise the test is terminated and a communication failure code is prompted.
[0022] Specifically, in order to quickly and accurately detect the precision of the sensor, the withstand voltage instrument, the calibration instrument, the relay control board and the computer terminal automatic test software are connected to form a closed-loop measurement and control system based on the manner as shown in Figure 2 Before detection, the computer terminal automatic test software sends a handshake frame to the withstand voltage instrument, the calibration instrument and the relay control board. If a correct response is obtained within a predetermined time, it is determined that the communication link is normal, otherwise the test is terminated and a communication failure code is prompted, so as to ensure the normal communication of the automatic test software and each device.
[0023] Step S2, a test script is generated based on the preset pole number, voltage value test point and precision threshold. Each voltage value test point of each pole is tested based on the test script, including: the relay control board closes the pole line according to the test order, controls the calibration instrument to collect sequence data of the pole at a preset sampling frequency, judges the arrival of the stable stage based on the sequence data, and the calibration instrument collects stable sequence data at a predetermined sampling frequency. The amplitude mean value and phase are obtained based on the stable sequence data and Kalman plus moving average double filtering, and the standard voltage of the corresponding voltage value test point is output by the withstand voltage instrument.
[0024] Specifically, the automatic test software also generates a test script based on the preset pole number, voltage value test point and precision threshold. The pole refers toFigure 2 The voltage value test points Ua, Ub, Uc, U0, Ua2, Ub2, Uc2 shown in the middle refer to 5%, 20%, 50%, 100%, and 105% of the voltage, and the accuracy threshold includes a first accuracy threshold and a second accuracy threshold. The accuracy threshold can be set according to the standard. The standard IEC61869 defines 0.5S level as being within 5%–120% of the rated voltage, with a relative error absolute value ≤0.5% and an angle difference absolute value ≤20′ (arc-min). Therefore, the first accuracy threshold can be 0.5%, and the second accuracy threshold can be 20. Based on the test script, each voltage value test point is automatically detected. The relay control board closes the pole line according to the test order, and the calibration instrument collects sequence data of the pole at a preset sampling frequency. Based on the sequence data, it is determined whether the stable stage is reached. The specific method of determining whether the stable stage is reached will be explained in detail later. The calibration instrument collects stable sequence data at a predetermined sampling frequency. The amplitude mean value and the phase are obtained based on the stable sequence data and the Kalman plus moving average double filtering. The standard voltage corresponding to the voltage value test point is output by the voltage withstand instrument. The purpose of automatically detecting the pole voltage acquisition unit can be achieved quickly, the test efficiency is improved, and the inaccuracy of the test results caused by human factors is reduced.
[0025] Step S3, based on the standard voltage, the amplitude mean value and the phase, the relative error and the angle difference are calculated. After each voltage value test point is tested, the pole number of the voltage value test point, the test point percentage, the standard voltage, the measured voltage, the relative error, the angle difference, the qualified state, the test timestamp, and the MD5 check value are generated as a test record and saved.
[0026] Specifically, based on the standard voltage, the amplitude mean value and the phase, the relative error and the angle difference are calculated. The specific calculation method will be explained in detail later. In order to ensure that the test results are traceable and provide a basis for subsequent product problem tracking, after each voltage value test point is tested, the pole number of the voltage value test point, the test point percentage, the standard voltage, the measured voltage, the relative error, the angle difference, the qualified state, the test timestamp, and the MD5 check value are generated as a test record and saved. The relative error refers to the relative error percentage of the measured amplitude and the amplitude corresponding to the standard voltage, which is used to quantify the amplitude linearity. The angle difference refers to the difference between the measured phase and the standard phase, which is used to quantify the phase delay. The MD5 check value refers to the 128-bit hash of each test record, which is used to ensure that the test record is not tampered with and meets the digital traceability requirements.
[0027] Step S4, after all the voltage value test points of all the poles are completed, a plurality of relative errors and angle differences are obtained. The maximum relative error and the maximum angle difference are obtained. The maximum relative error is compared with the preset first accuracy threshold, and the maximum angle difference is compared with the preset second accuracy threshold. Based on the comparison result, it is judged whether the voltage sensor accuracy is qualified.
[0028] Specifically, in order to determine whether the sensor is qualified, after all the voltage value test points of all the pole columns are completed, the plurality of ratio differences and angle differences are obtained, the maximum ratio difference and the maximum angle difference are obtained, and whether the whole sensor is qualified is determined through one comparison, avoiding point-by-point screening.
[0029] In a specific embodiment, the closed-loop measurement and control system is connected based on the following mode: The high-voltage output end of the withstand voltage instrument is connected to the common input end of the relay control board, each output end of the relay control board is connected to the primary side of the corresponding pole column, the secondary side small signal output end of each pole column is connected to the multi-channel input end of the calibration instrument, and the withstand voltage instrument and the calibration instrument are respectively connected to the computer end automatic test software through RS232 to establish a bidirectional communication connection, and the relay control board is connected to the computer end automatic test software through Ethernet to establish a bidirectional communication connection.
[0030] Specifically, as shown in Figure 2 The connection mode of the closed-loop measurement and control system is shown in the figure, the high-voltage output end of the withstand voltage instrument is connected to the common input end of the relay control board, each output end of the relay control board is connected to the primary side of the corresponding pole column, the secondary side small signal output end of each pole column is connected to the multi-channel input end of the calibration instrument, and the withstand voltage instrument and the calibration instrument are respectively connected to the computer end automatic test software through RS232 to establish a bidirectional communication connection, and the relay control board is connected to the computer end automatic test software through Ethernet to establish a bidirectional communication connection.
[0031] In a specific embodiment, the reaching of the stable stage is determined based on sequence data, and specifically includes the following steps: The real-time sampling data of the calibration instrument in the latest sampling period is read, a complex vector is obtained by taking the fundamental component after the real-time sampling data is subjected to discrete Fourier transform, the earliest sampling data is deleted and the new sampling data is added every time a new sampling data is obtained, the complex vector is subjected to discrete Fourier transform again and the fundamental component is taken to obtain a new complex vector, the instantaneous curvature of each sampling data is calculated based on the complex vector, the instantaneous curvature of each sampling data in two continuous periods is calculated, and if the instantaneous curvatures in the two continuous periods are less than a preset threshold, it is determined that the stable stage is reached.
[0032] Specifically, since the withstand voltage instrument outputs standard voltage, which is a set value, not a true value, and theoretically equals to the target value, but the high-voltage generator, feedback network and load conversion will cause the withstand voltage instrument to have transient overshoot, oscillation or drift at the real output end, the calibration instrument itself is a low-voltage precision measuring instrument, and the physical true value is collected in real time, so that the credibility of the calibration result can be ensured by using the true value for judgment, and therefore it is necessary to determine whether the stable stage is reached based on the calibration instrument.
[0033] The traditional judgment method for judging whether the stable stage is reached is that the standard requirement is considered to reach the stable stage after waiting for a preset time, and the upper limit of the standard requirement is generally 5s. In order to quickly and accurately judge whether the voltage-withstanding instrument reaches the output stable stage, the real-time sampling data of the latest sampling period of the calibration instrument is read, the real-time sampling data includes amplitude and phase, in order to compress the effective signal output by the calibration instrument into a complex number, facilitate subsequent calculation of curvature, the complex number vector is obtained by performing discrete Fourier transform on the real-time sampling data of the latest sampling period, for example, for any time i (corresponding to the i th sampling point), assuming that N samplings are performed in a sampling period, N latest continuous sampling data are obtained, discrete Fourier transform is performed on the N sampling data, and the complex number vector Z is obtained by retaining the fundamental wave component i =a i +jb i , wherein , , wherein N represents the number of sampling data in a sampling period, k is an integer, the value range is 0 to N-1, x k represents the k th sampling data, a i represents the i th fundamental wave cosine component, b i represents the i th fundamental wave sine component, the instantaneous amplitude is , and the phase is , after Fourier decomposition is performed on the periodic signal, the sine component of the lowest frequency is the fundamental wave component, and the integer multiple frequency is the harmonic, the fundamental wave component represents the effective voltage amplitude and effective phase, and the harmonic represents interference. By taking the fundamental wave component, the interference of high-frequency noise on the judgment stability can be eliminated. With the calibration instrument continuously sampling, the earliest sampling data is deleted, the new sampling data is added, the discrete Fourier transform is performed again, and the new complex number vector is obtained by taking the fundamental wave component. The instantaneous curvature of each sampling data is calculated based on the complex number vector sequence. The instantaneous curvature of each sampling data in two continuous periods is continuously calculated. If the instantaneous curvatures of two continuous periods are less than a preset threshold, it is determined that the stable stage is reached.
[0034] The above method replaces the waiting fixed delay by an adaptive calculation method, and can quickly and accurately judge whether the voltage-withstanding instrument reaches the output stable stage.
[0035] In a specific embodiment, the instantaneous curvature of each sampling data is calculated based on the complex number vector, including the following steps: For the i th sampling data, the previous sampling data and the next sampling data of the i th sampling data are obtained, the complex number vectors corresponding to the three adjacent sampling data are Z i-1 , Z i and Z i+1 , the first vector X=Z i -Zi-1 , calculate the second vector Y = Z i+1 -Z i , based on the first vector and the second vector, calculate the instantaneous curvature k corresponding to the i-th sampling data i , the calculation formula is , wherein lm represents the imaginary part of the complex number.
[0036] Specifically, the instantaneous curvature is regarded as a two-dimensional geometric problem of the direction angle on the unit arc length, the bending degree is measured by the vector cross product on the complex plane, the first vector X is the front chord, the second vector Y is the rear chord, lm represents the imaginary part of the complex number, is the cross product module, representing the area of the parallelogram formed by the front chord and the rear chord, the larger the area is, the more dramatic the direction transformation is, that is, the more severe the bending is, and the denominator is a piece of equivalent arc length representing the sum of the approximate chord length multiplied by the total chord length, which is used for normalization, so that the natural curvature is independent of the curve length.
[0037] In a specific embodiment, the amplitude mean and phase are obtained based on the stable sequence data and Kalman plus moving average double filtering, specifically including the following steps: Take one sampling period as a sliding window and one sampling data as a step, and perform discrete Fourier transform on the stable sequence data in the corresponding sliding window to obtain the fundamental complex vector corresponding to each period every time the sliding window slides, and obtain the amplitude and phase of the corresponding period based on the fundamental complex vector. The amplitudes of multiple periods form an amplitude sequence, and the amplitude sequence is processed by Kalman plus moving average double filtering to obtain the amplitude mean corresponding to each period.
[0038] Specifically, assuming that there are 40 sampling data in a period of stable sequence data, the 40 sampling data are subjected to discrete Fourier transform and the fundamental component is extracted, the modulus value of the fundamental component is taken and normalized to obtain the voltage amplitude, one sampling period is taken as a sliding window, one sampling data is taken as a sliding step, and the discrete Fourier transform is performed on the stable sequence data in the sliding window to obtain the fundamental complex vector corresponding to each sliding window (each period) every time the sliding window slides, and the amplitude and phase of the corresponding period are obtained based on the fundamental complex vector. After multiple sliding, an amplitude sequence composed of amplitudes of multiple periods can be obtained, and the amplitude sequence is processed by Kalman plus moving average double filtering to obtain the amplitude mean corresponding to each period. The specific method of obtaining the amplitude mean will be explained in detail later.
[0039] In a specific embodiment, the amplitude sequence is processed by Kalman plus moving average double filtering to obtain the amplitude mean, specifically including the following steps: The state vector is set as an amplitude value, the process noise covariance is configured according to prior thermal noise statistics, the observation noise covariance is estimated in real time through a no-load calibration stage, and the Kalman filter performs prior estimation, prior covariance calculation, Kalman gain calculation, posterior estimation and posterior covariance calculation once in each sampling interval to output real-time optimal estimation at each time, all optimal estimations form an optimal estimation sequence, the optimal estimation sequence is input into a moving average filter with a preset length, the coefficient of the moving average filter is determined based on the equal-weight average measurement of the optimal estimations in the window, and the sum of all outputs of the moving average filter is averaged to obtain a final amplitude mean value.
[0040] Specifically, although the calibrator has reached a macro-stable stage, there are still residual disturbances at the micro level. Since the amplitude error mainly comes from ADC quantization, temperature drift and high-frequency noise, its statistical model (zero-mean Gaussian) is suitable for Kalman hypothesis, so Kalman filtering with moving average is used for secondary noise reduction and true value extraction to suppress ADC quantization noise, weaken temperature drift and high-frequency noise interference and improve statistical confidence. The phase error is mainly caused by clock jitter and fixed delay, which usually shows as a systematic deviation rather than random noise. Therefore, the Kalman filter is not used for filtering the phase.
[0041] The state vector is a one-dimensional scalar containing only the voltage amplitude, which is used to describe the true amplitude level of the voltage at each time and provide the minimum complete information for the Kalman filter to predict and update. The process noise covariance is obtained based on a sensor front-end thermal noise model, which is represented by the following formula: wherein Q is the process noise covariance, k B is the Boltzmann constant, T is the absolute temperature, R eq is the equivalent resistance in the previous stage, which is obtained by connecting the voltage dividing network and the input impedance in parallel, and the typical value is 1.2kΩ, and Δt is the sampling interval. In the no-load calibration stage, that is, when the voltage meter outputs 0V and the relay is closed, M sampling data are collected, and the observation noise covariance O is calculated based on the following formula: wherein L n is the fundamental component corresponding to the nth sampling data, is the mean value of the n fundamental components, and O is the estimated observation noise covariance.
[0042] Taking the calculation of the optimal estimation at time t as an example, the posterior estimation at the previous time is known at time t. The prior estimation refers to the preliminary estimation or prediction of an unknown quantity based on existing knowledge, theoretical model or experience before the observation or experimental data is obtained, so the posterior estimation at the previous time is taken as the prior estimation , that is The prior covariance at time t is calculated using the following formula. , The posterior covariance at time t-1 is used. Kalman gain represents the reliability of the current actual observation data relative to the prior estimate. A smaller value of 0 indicates a more accurate measurement, and the closer the Kalman gain is to 1. The Kalman gain G is calculated using the following formula: t : O represents the observation noise variance, reflecting the noise level of the calibration instrument measurement, and is estimated posteriorly as... r t It is the noise-included amplitude value output by the calibrator at time t. The observation residuals are multiplied by the Kalman gain and added to the prior estimate to obtain the posterior estimate. The posterior estimate is then used as the real-time optimal estimate, and the posterior covariance is calculated using the following formula. The posterior covariance decreases, indicating the uncertainty of the real-time optimal estimate, which is used for the recursion at the next time step.
[0043] The real-time optimal estimate is input into a moving average filter with a preset window length, assuming the preset length is 5. The specific process of the moving average filter is as follows: For the real-time optimal estimate, the four nearest neighboring optimal estimates are obtained, and the average value of the real-time optimal estimate and these four neighboring optimal estimates is calculated. The final average value is used as the processing result of the moving average filter, and the final average value is used as the amplitude average value of the corresponding period for subsequent calculation of the ratio difference.
[0044] The Kalman filter uses the minimum mean square error criterion and incorporates both process noise and measurement noise into the estimation framework through a state-space model, recursively outputting the real-time optimal estimate. It significantly reduces random errors introduced by ADC quantization, thermal drift, and high-frequency interference at the amplitude and phase levels. By applying a moving average with a fixed window length, it smooths the low-frequency ripple and power frequency harmonics that have not been completely filtered out in the Kalman residual with a finite impulse response, further reducing residual noise and improving the overall signal-to-noise ratio by an order of magnitude. The Kalman filter is good at handling process and measurement noise with known statistical characteristics, while the moving average filter performs secondary suppression of residual colored noise with extremely low computational complexity. The two are complementary and do not introduce additional hardware, enabling the system to effectively reduce extended uncertainty with existing MCU resources, while reducing the total processing delay. The noise removal through the above dual filtering makes the subsequent calculation of the difference more accurate.
[0045] In one specific embodiment, the ratio difference and angle difference are calculated based on the standard voltage, the average amplitude, and the phase, specifically including the following steps: obtain a sampling period corresponding to the average amplitude, obtain a standard voltage corresponding to the sampling period of the voltage withstand instrument, perform a discrete Fourier transform on the standard voltage to obtain a corresponding standard amplitude and a standard phase, obtain a first difference by taking an absolute value of a difference between the standard amplitude and the average amplitude, and obtain a ratio difference by dividing the first difference by the standard amplitude; obtain a phase corresponding to the average amplitude, referred to as a measured phase, and obtain an angle difference by taking an absolute value of a difference between the standard phase and the measured phase.
[0046] Specifically, the ratio difference and the angle difference of each voltage value test point are calculated based on the above method, which facilitates subsequent judgment of whether the voltage sensor precision is qualified based on the ratio difference and the angle difference.
[0047] In a specific embodiment, whether the sensor precision is qualified is judged based on the comparison result, and specifically includes the following steps: If the maximum ratio difference is less than the first precision threshold and the maximum angle difference is less than the second precision threshold, it is judged that the sensor precision is qualified, otherwise it is judged that the sensor precision is not qualified.
[0048] Specifically, if the maximum ratio difference is less than the first precision threshold and the maximum angle difference is less than the second precision threshold, it indicates that the voltage sensor precision meets the predetermined standard, otherwise it indicates that the voltage sensor does not meet the predetermined standard and needs to be calibrated. The above method can quickly and accurately judge whether the sensor precision is qualified.
[0049] The above describes a method for detecting the precision of a voltage sensor in an embodiment of the application, and the following describes a system for detecting the precision of a voltage sensor in an embodiment of the application. Please refer to Figure 3 One embodiment of the system for detecting the precision of a voltage sensor in an embodiment of the application includes: A communication establishment module, the computer terminal automatic test software sends a handshake frame to the voltage withstand instrument, the calibration instrument and the relay control board, if a correct response is obtained within a predetermined time, it is determined that the communication link is normal, otherwise the test is terminated and a communication failure code is prompted; A data processing module, a test script is generated based on a preset pole number, a voltage value test point and a precision threshold, each voltage value test point of each pole is tested based on the test script, including: the relay control board closes the pole line according to the test order, the calibration instrument collects sequence data of the pole at a preset sampling frequency, after it is determined that the stable stage is reached based on the sequence data, the calibration instrument collects stable sequence data at a predetermined sampling frequency, the average amplitude and the phase are obtained based on the stable sequence data and the Kalman plus moving average double filtering, and the standard voltage corresponding to the voltage value test point is output by the voltage withstand instrument; The data storage module calculates the ratio difference and the angle difference based on the standard voltage, the amplitude mean value and the phase, generates a test record of the pole number, the test point percentage, the standard voltage, the measured voltage, the ratio difference, the angle difference, the qualified state, the test time stamp and the MD5 check value of the voltage test point, and saves the test record after each voltage test point is tested; The precision judgment module obtains a plurality of ratio differences and angle differences after all voltage test points of all poles are completed, obtains a maximum ratio difference and a maximum angle difference, compares the maximum ratio difference with a preset first precision threshold, compares the maximum angle difference with a preset second precision threshold, and judges whether the voltage sensor precision is qualified based on the comparison results.
[0050] The application also provides a computer readable storage medium, which can be a non-volatile computer readable storage medium or a volatile computer readable storage medium. The computer readable storage medium stores instructions, and when the instructions are run on a computer, the computer executes the steps of the method for detecting the precision of the voltage sensor.
[0051] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, system and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0052] The integrated unit, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and various program code storage media.
[0053] The above-described embodiments are only used to illustrate the technical solutions of the application, rather than limit them; although the application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the application.
Claims
1. A method for detection of accuracy of a voltage sensor, characterized in that, The closed-loop measurement and control system is composed of a pressure-withstanding instrument, a calibration instrument, a relay control board and computer terminal automatic test software, and one-time precision detection of all pole column voltage collection channels in a deep fusion circuit breaker is realized in an automatic and traceable manner, and the method comprises the following steps: The computer terminal automatic test software sends a handshake frame to the pressure-withstanding instrument, the calibration instrument and the relay control board, and if a correct response is obtained within a predetermined time, it is determined that the communication link is normal, otherwise the test is terminated and a communication failure code is prompted; A test script is generated based on preset pole column numbers, voltage value test points and precision thresholds, and each voltage value test point of each pole column is tested based on the test script, including: the relay control board closes the pole column line according to the test sequence, controls the calibration instrument to collect sequence data of the pole column at a preset sampling frequency, judges that the stable stage is reached based on the sequence data, and the calibration instrument collects stable sequence data at a predetermined sampling frequency, and the standard voltage of the corresponding voltage value test point is output by the pressure-withstanding instrument based on the stable sequence data and Kalman plus moving average double filtering to obtain the amplitude mean value and the phase; The ratio difference and the angle difference are calculated based on the standard voltage, the amplitude mean value and the phase, and after each voltage value test point is tested, the pole column number, the test point percentage, the standard voltage, the measured voltage, the ratio difference, the angle difference, the qualified state, the test time stamp and the MD5 check value of the voltage value test point are generated into a test record and saved; After all voltage value test points of all pole columns are completed, multiple ratio differences and angle differences are obtained, the maximum ratio difference and the maximum angle difference are obtained, the maximum ratio difference is compared with the preset first precision threshold, the maximum angle difference is compared with the preset second precision threshold, and whether the voltage sensor precision is qualified is judged based on the comparison result.
2. The method of claim 1, wherein, The closed-loop measurement and control system is connected based on the following mode: The high-voltage output end of the pressure-withstanding instrument is connected to the common input end of the relay control board, each output end of the relay control board is connected to the primary side of the corresponding pole column, the secondary side small signal output end of each pole column is connected to the multi-channel input end of the calibration instrument, and the pressure-withstanding instrument and the calibration instrument are respectively connected to the computer terminal automatic test software through RS232 to establish a bidirectional communication connection, and the relay control board is connected to the computer terminal automatic test software through Ethernet to establish a bidirectional communication connection.
3. The method of claim 1, wherein, After it is judged that the stable stage is reached based on the sequence data, the following steps are included: Real-time sampling data of the calibration instrument in the latest sampling period is read, a complex vector is obtained by taking the real-time sampling data to do discrete Fourier transform and take the fundamental component, every time a new sampling data is collected, the earliest sampling data is deleted, the new sampling data is added, a new complex vector is obtained by doing discrete Fourier transform again and taking the fundamental component, the instantaneous curvature of each sampling data is calculated based on the complex vector, the instantaneous curvature of each sampling data in two continuous periods is calculated, and if the instantaneous curvatures in the two continuous periods are both less than a preset threshold, it is determined that the stable stage is reached.
4. The method of claim 3, wherein, The instantaneous curvature of each sampling data is calculated based on the complex vector, including: For the i-th sampling data, the previous sampling data and the next sampling data of the i-th sampling data are obtained, and the complex vectors corresponding to the three adjacent sampling data are Z i-1 , Z i and Z i+1 respectively, a first vector X=Z i -Z i-1 is calculated, a second vector Y=Z i+1 -Z i is calculated, and the instantaneous curvature k i corresponding to the i-th sampling data is calculated based on the first vector and the second vector, and the calculation formula is wherein, lm represents the imaginary part of the complex number.
5. The method of claim 1, wherein, The amplitude mean value and the phase are obtained based on the stable sequence data and Kalman plus moving average double filtering, including: A sampling period is taken as a sliding window, and a sampling data is taken as a step size, a stable sequence data row of multiple sampling periods is subjected to a discrete Fourier transform to obtain a fundamental complex vector corresponding to each period, and an amplitude and a phase of the corresponding period are obtained based on the fundamental complex vector; Amplitudes of multiple periods form an amplitude sequence, and phases of multiple periods form a phase sequence, and a Kalman plus moving average double filtering processing is performed on the amplitude sequence to obtain an amplitude mean value corresponding to each period.
6. The method of claim 1, wherein, The Kalman plus moving average double filtering processing on the amplitude sequence to obtain the amplitude mean value includes: The state vector is set as the amplitude sequence, the process noise covariance is configured according to the prior thermal noise statistics, and the observation noise covariance is estimated in real time through the no-load calibration stage, the Kalman filter performs prior estimation, prior covariance calculation, Kalman gain calculation, posterior estimation and posterior covariance calculation once in each sampling beat to output the real-time optimal estimation at each time, all optimal estimations form an optimal estimation sequence, the optimal estimation sequence is input into a moving average filter with a preset length as a window length, the coefficients of the moving average filter are determined based on the equal-weight average measurement of the optimal estimations in the window, and the amplitude mean value is obtained by summing and averaging all outputs of the moving average filter.
7. The method of claim 1, wherein, The ratio difference and the angle difference are calculated based on the standard voltage, the amplitude mean value and the phase, including: A sampling period corresponding to the amplitude mean value is obtained, a standard voltage corresponding to the sampling period of the withstand voltage instrument is obtained, a standard amplitude and a standard phase are obtained by performing a discrete Fourier transform on the standard voltage, a first difference value is obtained by subtracting the amplitude mean value from the standard amplitude and taking an absolute value, and a ratio difference is obtained by dividing the first difference value by the standard amplitude; A phase corresponding to the amplitude mean value is called a measured phase, and an angle difference is obtained by subtracting the measured phase from the standard phase and taking an absolute value.
8. The method of claim 1, wherein, The sensor precision is judged to be qualified or unqualified based on the comparison result, including: If the maximum ratio difference is less than a first precision threshold and the maximum angle difference is less than a second precision threshold, the sensor precision is judged to be qualified, otherwise the sensor precision is judged to be unqualified.
9. A detection system for voltage sensor accuracy for implementing the detection method for voltage sensor accuracy according to any one of claims 1-8, characterized in that, The system includes: A communication establishment module, the computer terminal automatic test software sends a handshake frame to the withstand voltage instrument, the calibration instrument and the relay control board, if a correct response is obtained within a predetermined time, it is determined that the communication link is normal, otherwise the test is terminated and a communication fault code is prompted; A data processing module, a test script is generated based on a preset pole number, a voltage value test point and a precision threshold, each voltage value test point of each pole is tested based on the test script, including: the relay control board closes the pole line according to the test order, controls the calibration instrument to collect sequence data of the pole at a preset sampling frequency, judges that the stable stage is reached based on the sequence data, the calibration instrument collects stable sequence data at a predetermined sampling frequency, and the amplitude mean value and the phase are obtained based on the stable sequence data and the Kalman plus moving average double filtering, and the standard voltage of the corresponding voltage value test point is output by the withstand voltage instrument. The data storage module calculates the ratio difference and the angle difference based on the standard voltage, the amplitude mean value and the phase, generates a test record of the pole number, the test point percentage, the standard voltage, the measured voltage, the ratio difference, the angle difference, the qualified state, the test time stamp and the MD5 check value of the voltage test point after each voltage test point is tested, and saves the test record; The precision judgment module obtains multiple ratio differences and angle differences after all voltage test points of all poles are completed, obtains the maximum ratio difference and the maximum angle difference, compares the maximum ratio difference with a preset first precision threshold value, compares the maximum angle difference with a preset second precision threshold value, and judges whether the voltage sensor precision is qualified based on the comparison results.
10. A computer-readable storage medium having stored thereon instructions, the instructions comprising, The instructions are executed by the processor to implement the detection method for voltage sensor precision in any one of claims 1-8.
Citation Information
Patent Citations
Electric energy meter voltage withstand test system and method with automatic test voltage switching function
CN107064853A
Alternating current withstand voltage detection system for intelligent electric energy meter and electricity consumption information collection terminal
CN109143145A
Comprehensive testing system and method for digital electric energy metering equipment
CN109031182A
Non-contact voltage sensor correction system and method
CN115586476A
Tester and test method of current transformer
CN118330540A