A kind of determination methods of alternating current detection unit failure
Technical field
The present invention relates to electrical quantity detection field, particularly a kind of determination methods of alternating current detection unit failure.
Background technology
Positive and negative alternate AC characteristic is presented in the voltage or electric current for exchanging electricity output, by detection unit detect its voltage or
Current parameters also have the same AC characteristic of family, if detection unit fails, typically exhibit DC characteristic, i.e. detection unit
The magnitude of voltage or current value of output will keep on the occasion of negative value or 0 output, that is, lose positive and negative alternate AC characteristic.Uninterrupted electricity
In normal operating conditions, its output is alternating current for source or inverter, production testing must be carried out before product export, between detection not
Whether power-off source or inverter are qualified, and whether one of important parameter seeks to detect its output normal.Common practice is
Whether the curtage for detecting its output using current detecting unit or voltage detection unit has AC characteristic.But such as
Fruit, because detection unit itself is damaged but do not found in time, may cause testing result to be slipped up, influence just in detection process
Really judge.Hall sensor because the features such as its is simple in construction, small volume, linear convergent rate be widely used in electrical quantity detection in,
But the damage of Hall sensor is not easy to be found again.The determination methods that the present invention is failed using a kind of alternating current detection unit,
Whether damaged available for detection Hall sensor.
The content of the invention
It is an object of the invention to provide a kind of determination methods of alternating current detection unit failure, to overcome in the prior art
The defects of existing.
To achieve the above object, the technical scheme is that:A kind of determination methods of alternating current detection unit failure, are pressed
Realized according to following steps:
Step S1:The magnitude of voltage or current value that timing Ts exports to an alternating current detection unit sample;By each sampled value
After compared with an a reference value, the sampled value is converted into binary system bit code 1 or 0, and by the binary system bit code step-by-step
It is stored in a memory cell;Judge to sample A sampled value in the cycle altogether one, and judgement cycle A*Ts is not less than the friendship
Flow the cycle T of electricity;
Step S2:Step-by-step is read and counts binary system bit code 1 and 0 number in the memory cell, is designated as B and C respectively;
Step S3:By B, C respectively compared with a threshold value, or incite somebody to action | B-C | compared with the threshold value;When at least B or C
One be less than the threshold value or | B-C | more than threshold value, be then judged as the alternating current detection unit failure;Wherein, | B-C | it is B and C
Difference absolute value.
In an embodiment of the present invention,, will when the sampled value is more than or equal to a reference value in the step S1
The sampled value is converted to binary system bit code 1;When the sampled value is less than a reference value, the sampled value is converted to two
System bit code 0.
In an embodiment of the present invention, a reference value is 0.
In an embodiment of the present invention, in step sl, a reference value includes first reference value and the second a reference value;Institute
Stating memory cell includes the first memory cell and the second memory cell;
By each sampled value compared with the first reference value, when the sampled value is more than or equal to the first reference value, by this
Sampled value is converted to binary system bit code 1;When the sampled value is less than the first reference value, the sampled value is converted into binary system
Bit code 0, and the step-by-step of binary system bit code 1 or 0 after conversion is stored to first memory cell;
By each sampled value compared with the second a reference value, when the sampled value is more than or equal to second a reference value, this is sampled
Value is converted to binary system bit code 1;When the sampled value is less than second a reference value, the sampled value is converted into binary system bit code
0, and the step-by-step of binary system bit code 1 or 0 after conversion is stored to second memory cell;
In the step S2, step-by-step is read, and is counted respectively two in first memory cell and second memory cell
System bit code 1 and 0 number, and the number of binary system bit code 1 is designated as B1 and B2 respectively, the number of binary system bit code 0 is distinguished
It is designated as C1 and C2;Wherein, B1 is the number of binary system bit code 1 in the first memory cell, and C1 is binary system in the first memory cell
The number of bit code 0, B2 are the number of binary system bit code 1 in the second memory cell, and C2 is binary system bit code 0 in the second memory cell
Number;
In the step S3, by B1, C1, B2, C2 respectively compared with threshold value, or | B1-C2 | compared with threshold value;When
At least any one of B1 or C2 be less than threshold value or | B1-C2 | during more than threshold value, be then judged as alternating current detection unit failure;
Wherein, | B1-C2 | for the absolute value of B1 and C2 difference.
In an embodiment of the present invention, the first reference value has no more than the voltage of alternating current detection unit output
The 5% of valid value or current effective value, second a reference value not less than the alternating current voltage virtual value or current effective value-
5%。
In an embodiment of the present invention, as (K+0.5) * T > A*Ts >=K*T, the threshold value is K*T/ (2*Ts) -3;
When(K+1)* during T > A*Ts >=(K+0.5) * T, the threshold value is A-K*T/ (2*Ts) -3;
Wherein, K is positive integer, and K >=1.
In an embodiment of the present invention, one number of samples A=32 or A=64 judged in the cycle.
In an embodiment of the present invention, the timing Ts=1ms.
In an embodiment of the present invention, the alternating current detection unit is Hall AC current sensor.
Compared to prior art, the invention has the advantages that:
(1)The determination methods of alternating current detection unit failure proposed by the invention, timing sampling obtain sampled value, and will sampling
Value is converted to binary system bit code 1 or 0, step-by-step access, and a byte includes 8 positions, equivalent to that can store 8 sampled values, greatly
The big occupancy for reducing memory space;And then network bandwidth can be saved, realize compact access.
(2)In computer realm, storage variable needs to take different byte numbers, data according to different data types
Type generally has the Byte bytes type of 1 byte, the Boolean Boolean types of 2 bytes or integer integer types, 4 bytes
The double double-precision floating point types etc. of long longs, 8 bytes, the byte number that the present invention takes according to the data type of definition
It is determined that obtaining 32 sampled values, the corresponding variable for being stored as 4 bytes, i.e., one judges that the cycle only saves as 1 or 2
Long longs variable can store whole sampled values, make full use of memory space simultaneously and ensure enough number of samples;And
Judge that the cycle is more than the cycle for being detected alternating current, it is ensured that the data of sampling are effective.
(3)The present invention by counting the number of binary system bit code 1 or 0, it is determined that judge in the cycle exchange electricity output on the occasion of
Or the number of negative value, determine whether output is presented DC characteristic according to number, determination methods are easy and effective.
(4)If exchanged, electricity output is normal, and 1 and 0 number should be equal in theory, if output is direct current,
In theory sampled value should be continuously on the occasion of or negative value or 0, but in actual applications, the electric current that DC characteristic may be presented also may be used
Can have situations such as mutation, spike causes sampled result a series of on the occasion of including negative value etc., and the present invention is by representing just
The 1 of value(Or 0)With represent the 0 of negative value(Or 1)Number respectively compared with threshold value, it is true according to its relation between threshold value
Whether fixed output loses AC characteristic, and threshold value is rationally to determine there is one according to the frequency for judging cycle and detected alternating current
Fixed fault tolerant workspace, judged result are more reasonable accurate.
(5)Present invention also offers sampled value is divided on the occasion of, negative value by first reference value and the second a reference value and
With respect to 0 value, each sampled value is compared respectively at first reference value and the second a reference value and is converted into binary system bit code, is adopted
Stored respectively with the memory cell of 2 32, the feelings on the occasion of, negative value and relative 0 value can be read from the memory cell of 2 32
Condition, it can more accurately judge sampled value on the occasion of the distribution situation with negative value.
Brief description of the drawings
Fig. 1 is the flow chart of embodiment one in the present invention.
Fig. 2 is the flow chart of embodiment two in the present invention.
Fig. 3 for the present invention in Ts=1ms, threshold value distribution map of the frequency in 45Hz to 65Hz.
Embodiment
Below in conjunction with the accompanying drawings, technical scheme is specifically described.
Embodiment one
The present invention provides a kind of determination methods of alternating current detection unit failure, as shown in figure 1, realizing in accordance with the following steps:
Step S1:The magnitude of voltage or current value that timing Ts exports to an alternating current detection unit sample;By each sampled value
After compared with an a reference value, sampled value is converted into binary system bit code 1 or 0, and binary system bit code step-by-step is stored in one
Memory cell;Judge to sample A sampled value in the cycle altogether one, and judge that cycle A*Ts is not less than the cycle T of the alternating current;
Step S2:Step-by-step is read and binary system bit code 1 and 0 number in statistics storage unit, is designated as B and C respectively;
Step S3:By B, C respectively compared with a threshold value, or incite somebody to action | B-C | compared with the threshold value;When at least B or C
One be less than the threshold value or | B-C | more than threshold value, be then judged as that alternating current detection unit fails;Wherein, | B-C | it is B and C difference
Absolute value.
Further, in the present embodiment, in step sl, when sampled value is more than or equal to a reference value, sampled value is turned
It is changed to binary system bit code 1;When sampled value is less than a reference value, sampled value is converted into binary system bit code 0, and a reference value
For 0.
Further, in the present embodiment,
As (K+0.5) * T > A*Ts >=K*T, threshold value is K*T/ (2*Ts) -3;
When(K+1)* during T > A*Ts >=(K+0.5) * T, threshold value is A-K*T/ (2*Ts) -3;
Wherein, K is positive integer, and K >=1.
In the present embodiment, threshold value falls between half and the number of samples of a cycle, as shown in Figure 3, it is contemplated that inspection
There can be the error of 1~2 point during survey, therefore subtract 3, so as not to it is misjudged.
Further, in the present embodiment, number of samples A=32 or A=64 judged in the cycle.In the present embodiment
In, memory cell can store the data of 32(4 bytes), A=32 are selected, the variable for allowing for storage is 32, similarly
64 can also be used(8 bytes)
Further, in the present embodiment, timing Ts=1ms.
Further, in the present embodiment, alternating current detection unit is Hall AC current sensor.
Further, the rated frequency of China's AC network is 50Hz, and the output frequency of uninterrupted power source and inverter leads to
This scope is often distributed in, there is certain representativeness.As shown in Fig. 3 and table 1 below, for Ts=1ms in the present invention, frequency exists
45Hz to 65Hz threshold value distribution.
Table 1
Embodiment two
The present invention provides a kind of determination methods of alternating current detection unit failure, as shown in Fig. 2 realizing in accordance with the following steps:
Step S1:The magnitude of voltage or current value that timing Ts exports to an alternating current detection unit sample;By each sampled value
After compared with an a reference value, sampled value is converted into binary system bit code 1 or 0, and binary system bit code step-by-step is stored in one
Memory cell;Judge to sample A sampled value in the cycle altogether one, and judge that cycle A*Ts is not less than the cycle T of the alternating current;
Step S2:Step-by-step is read and binary system bit code 1 and 0 number in statistics storage unit, is designated as B and C respectively;
Step S3:By B, C respectively compared with a threshold value, or incite somebody to action | B-C | compared with the threshold value;When at least B or C
One be less than the threshold value or | B-C | more than threshold value, be then judged as that alternating current detection unit fails;Wherein, | B-C | it is B and C difference
Absolute value.
Further, in the present embodiment, in step sl, a reference value includes first reference value and the second a reference value;Deposit
Storage unit includes the first memory cell and the second memory cell;
By each sampled value compared with the first reference value, when the sampled value is more than or equal to the first reference value, by this
Sampled value is converted to binary system bit code 1;When the sampled value is less than the first reference value, the sampled value is converted into binary system
Bit code 0, and the step-by-step of binary system bit code 1 or 0 after conversion is stored to first memory cell;
By each sampled value compared with the second a reference value, when the sampled value is more than or equal to second a reference value, this is sampled
Value is converted to binary system bit code 1;When the sampled value is less than second a reference value, the sampled value is converted into binary system bit code
0, and the step-by-step of binary system bit code 1 or 0 after conversion is stored to second memory cell;
In step s 2, step-by-step is read, and counts binary system in first memory cell and second memory cell respectively
Bit code 1 and 0 number, and the number of binary system bit code 1 is designated as B1 and B2 respectively, the number of binary system bit code 0 is designated as respectively
C1 and C2;Wherein, B1 is the number of binary system bit code 1 in the first memory cell, and C1 is binary system bit code in the first memory cell
0 number, B2 are the number of binary system bit code 1 in the second memory cell, and C2 is of binary system bit code 0 in the second memory cell
Number;
In step s3, by B1, C1, B2, C2 respectively compared with threshold value, or | B1-C2 | compared with threshold value;When at least
Any one of B1 or C2 be less than threshold value or | B1-C2 | during more than threshold value, be then judged as alternating current detection unit failure;Its
In, | B1-C2 | for the absolute value of B1 and C2 difference.
Further, in the present embodiment, the first reference value is not more than the electricity of alternating current detection unit output
The 5% of valid value or current effective value is pressed with, second a reference value is not less than the alternating current voltage virtual value or current effective value
- 5%.
Further, in the present embodiment,
As (K+0.5) * T > A*Ts >=K*T, threshold value is K*T/ (2*Ts) -3;
When(K+1)* during T > A*Ts >=(K+0.5) * T, threshold value is A-K*T/ (2*Ts) -3;
Wherein, K is positive integer, and K >=1.
In the present embodiment, threshold value falls between half and the number of samples of a cycle, as shown in Figure 3, it is contemplated that inspection
There can be the error of 1~2 point during survey, therefore subtract 3, so as not to it is misjudged.
Further, in the present embodiment, number of samples A=32 or A=64 judged in the cycle.In the present embodiment
In, memory cell can store the data of 32(4 bytes), A=32 are selected, the variable for allowing for storage is 32, similarly
64 can also be used(8 bytes)
Further, in the present embodiment, timing Ts=1ms.
Further, in the present embodiment, alternating current detection unit is Hall AC current sensor.
Further, the rated frequency of China's AC network is 50Hz, and the output frequency of uninterrupted power source and inverter leads to
This scope is often distributed in, there is certain representativeness.As shown in Fig. 3 and table 1, for Ts=1ms in the present invention, frequency exists
45Hz to 65Hz threshold value distribution.
Embodiment three
In the single-phase detection that Hall fails in UPS, tradition is by judging the virtual value of three-phase inversion electric current sum beyond a certain
Threshold value detects the method for Hall AC current sensor failure, is often confined to three-phase three wire system, for three-phase and four-line or
Monophase system is invalid.Conventional method can only often judge that Hall AC current sensor fails, and which can not specifically be navigated to
Phase Hall AC current sensor fails.
Further, the inverter current under UPS normal works it is no matter unloaded or it is fully loaded can show AC characteristic, suddenly
The inverter current that your failure case down-sampling obtains more shows DC characteristic.Feature extraction based on more than, in this reality
Apply in example, first reference value and the second a reference value are identified as 3A and -3A, and sample rate current is divided into positive area(>3A), minus zone
(<-3A)With 0th area(Between -3A to 3A), it is nearest in 1ms tasks using the variable of two 32 to record sample rate current respectively
32ms Nei Zheng areas and minus zone residence time, preset by judging that sample rate current is less than one in positive area or minus zone residence time
Threshold value can be to detect above-mentioned Hall failure case.
Further, in the present embodiment, for sampling signal frequency 45Hz to 65Hz Hall abatement detecting method,
Wherein, the minimum time that positive area is operated in the sinusoidal signal 32ms times of 45Hz to 46.875Hz frequency bands is 1 to 1.5
Between cycle, predetermined threshold value A can be defined as the time of 0.5 sinusoidal cycles.Sines of the 46.875Hz to 62.5 Hz frequency bands
Signal operates in the minimum time in positive area between 1.5 to 2 cycles in the 32ms times, predetermined threshold value A can be defined as
32ms subtracts the time of 1 sinusoidal cycles.Positive area is operated in the sinusoidal signal 32ms times of 62.5 Hz to 65Hz frequency bands
For minimum time between 2 to 2.5 cycles, predetermined threshold value A can be defined as the time of 1 sinusoidal cycles.
Further, it is contemplated that detection scheme performs the error that can have 1~2 point in 1ms tasks, therefore by threshold value
A points are defined as 8.In this embodiment, two kinds of Hall failure cases are simulated(Fault value Luo Zheng areas and 0th area)And failure inspection
Survey and two processes of fault recovery, sine wave freuqency corresponding to minimum time minimum point in Fig. 3 is selected in simulation example in addition
47Hz.When Hall failure causes detection signal to become DC characteristic situation by AC characteristic, detection that the present embodiment is proposed
Method can be detected fast and effeciently.
Above is presently preferred embodiments of the present invention, all changes made according to technical solution of the present invention, caused function are made
During with scope without departing from technical solution of the present invention, protection scope of the present invention is belonged to.