The utility model content
The utility model is to the defective that the system of existing detection alternating voltage can't accurately detect the alternating voltage of changeable frequency, and a kind of device, the system and method that can accurately measure the alternating voltage of changeable frequency is provided.
The utility model solves the technical scheme that its technical matters adopted:
The device of the variable alternating voltage of a kind of survey frequency is provided; Comprise and receive alternating current and it is carried out analog-to-digital analog-to-digital conversion module; Detect and the rising edge of the synperiodic square-wave signal of said alternating current or negative edge output cyclomorphosis edges of signals detection module when detecting said rising edge or negative edge also, and receive the magnitude of voltage of the said alternating current of said cyclomorphosis signal after and calculate the central processing circuit of the average voltage level in the current period with analog to digital conversion in the sampling current period.
The device of the alternating voltage that the survey frequency of the utility model is variable; Said central processing circuit comprises the timing circuit that is preset with sampling time interval, and receive that said cyclomorphosis signal enables said timing circuit, the magnitude of voltage of the alternating current in the said sampling time interval sampling current period that provides according to said timing circuit after the analog to digital conversion and calculate the central processing unit of the average voltage level in the current period.
Preferably, said central processing circuit also comprises the memory module that is internal or external at said central processing circuit.
Preferably, said central processing unit also comprises and judges whether current number of samples exceeds the judge module of the maximum number of samples that its internal memory can store.
The system of the variable alternating voltage of a kind of survey frequency is provided; Comprise generator,, receive alternating current, generation and the synperiodic square-wave signal of said alternating current of said adjustment circuit output and the comparator circuit of output the adjustment circuit that the alternating current of said generator output carries out step-down, filtering, dividing potential drop adjustment; And a plurality of LED lamps; It is characterized in that said system also comprises the measurement mechanism of alternating voltage, the measurement mechanism of said alternating voltage comprises:
Receive the alternating current of said adjustment circuit output and it is carried out analog-to-digital analog-to-digital conversion module;
Detect rising edge or the negative edge and the output cyclomorphosis edges of signals detection module when detecting rising edge or negative edge of the said square-wave signal of said comparator circuit output;
Receive behind the said cyclomorphosis signal magnitude of voltage, calculate the average voltage level of current period and drive the central processing circuit that said LED lamp shows said average voltage level corresponding grades according to the alternating current after the analog to digital conversion conversion in the preset sampling time interval sampling current period.
The system of the alternating voltage that the survey frequency of the utility model is variable; Said central processing circuit (130) comprises the timing circuit that is preset with sampling time interval, and receives that said cyclomorphosis signal enables said timing circuit, the magnitude of voltage in the said sampling time interval sampling current period that provides according to said timing circuit after the analog to digital conversion, calculates the average voltage level of current period and drive the central processing unit that said LED lamp shows said average voltage level corresponding grades.
Preferably, said central processing circuit also comprises the memory module that is internal or external at said central processing circuit.
Preferably, said central processing unit also comprises and judges whether current number of samples exceeds the judge module of the maximum number of samples that its internal memory can store.
Preferably, said system comprises 6 said LED lamps.
The method of the alternating voltage that the survey frequency of the utility model is variable has following beneficial effect: keep sampling time interval constant; Whether change through detecting with the rising edge of the synperiodic square-wave signal of alternating current or the cycle that negative edge is judged alternating current; And when ac period changes; End is to the sampling and the alternating voltage in the new cycle of sampling of alternating voltage of last one-period; Sampled point quantity is become according to the length in alternating voltage cycle, realize accurate measurement the alternating voltage of changeable frequency.
The system of the alternating voltage that the survey frequency of the utility model is variable has the identical beneficial effect of device with the variable alternating voltage of the survey frequency of the utility model, repeats no more at this.
Embodiment
Below in conjunction with accompanying drawing and embodiment the utility model is done further and to be explained.
Fig. 3 is the system chart of first embodiment of system of the variable alternating voltage of the survey frequency of the utility model; As shown in Figure 3, in the present embodiment, said system comprises generator 200; The alternating current of generator 200 outputs is carried out the adjustment circuit 300 of step-down, filtering, dividing potential drop adjustment; Receive alternating current, generation and the synperiodic square-wave signal of this alternating current of adjustment circuit 300 outputs and the comparator circuit 400 of output, a plurality of LED lamps 500, and the measurement mechanism 100 of alternating voltage.Wherein, the measurement mechanism 100 of alternating voltage comprises:
Analog-to-digital conversion module 110 is used to receive the alternating current of adjustment circuit 300 outputs and it is carried out analog to digital conversion;
Edge detection module 120 is used to detect the rising edge or the negative edge of the square-wave signal of comparator circuit 400 outputs, and when detecting negative edge output cyclomorphosis signal; And
Central processing circuit 130, its after receiving said cyclomorphosis signal according to preset sampling time interval to current period in the magnitude of voltage of alternating current after the analog to digital conversion sample, and calculate the mean value of all magnitudes of voltage that in current period, sample.
With reference to shown in Figure 3, generator 200 output voltages are adjusted to the voltage range that ac voltage measurement device 100 can directly be handled through 300 step-downs of adjustment circuit, filtering and dividing potential drop; Ac voltage measurement device 100 ceaselessly carries out sample conversion to the voltage signal of adjustment circuit 300 outputs through built-in analog-to-digital conversion module 110; The voltage signal of adjusting circuit 300 outputs simultaneously produces the square-wave signal consistent with ac period through comparator circuit 400; (rising edge or negative edge through detecting this square-wave signal all can judge whether to begin new ac period to the negative edge of the square-wave signal of the continuous inquiry of edge detection module 120 meetings comparator circuit 400 outputs of ac voltage measurement device 100; Can adopt the inquiry rising edge in other embodiments); When detecting negative edge; Think that voltage cycle begins, output cyclomorphosis signal; Central processing circuit 130 just enables interrupt routine and reads the analog-to-digital result of voltage magnitude this moment when receiving said cyclomorphosis signal, and the execution interval of interrupt routine equals sampling time interval, and sampling time interval can be provided with in advance; Detect at edge detection module 120 before the negative edge of new square-wave signal; The interrupt routine of central processing circuit 130 is in enabled always; In case edge detection module 120 detects new square-wave signal negative edge, output cyclomorphosis signal; 130 of central processing circuits stop interrupt routine; The institute that central processing circuit 130 is sampled before this belongs to same voltage cycle a little, and central processing circuit 130 calculates the interior mean value that samples magnitude of voltage of a voltage cycle and shows the corresponding electric pressure of average voltage that calculates through driving a plurality of LED lamps 500.
Fig. 4 is the sampled point exemplary plot of alternating voltage of the systematic survey changeable frequency of the utility model; As shown in Figure 4; A is the alternating current voltage curve of changeable frequency; The square-wave signal (its cycle with alternating current voltage identical) of B for producing through comparator circuit 400, C is the sampled point that 100 pairs of magnitudes of voltage of ac voltage measurement device of the utility model are sampled.System's employing variable period mensuration maintenance sampling time interval of the utility model is constant, and (SI decides according to the resource of ac voltage measurement device 100, gets the minimal sampling time interval that ac voltage measurement device 100 can be realized.Sampling time interval is more little, and sampled point is many more, and calculated value is accurate more), sampled point quantity is unfixing in advance, but becomes according to alternating voltage cycle length.This is the reason that can realize the variable period voltage measurement, also is with the measuring system before improving, the place that method has fundamental difference.With reference among the figure 4 shown in the C, in previous ac period,, can accomplish 8 samplings according to the sampling time interval of prior setting, sampled point quantity is 8.In next ac period; SI is constant; After collecting the 6th sampled point, ac voltage measurement device 100 detects the negative edge of square-wave signal, indicates to get into new ac period; This moment, sampled point quantity was 6, and single-chip microcomputer will calculate the average voltage in this cycle with these 6 sampled values.According to actual measured results, the variable period ac voltage that adopts this method to measure is more pressed close to actual value than existing method.
In the said system of the utility model; Adjustment circuit 300 can comprise the transformer that is used for transformation (for example step-down), the voltage (like divider resistance) that is used for the circuit of filtering and is used for dividing potential drop; Comparator circuit 400 can adopt existing comparator circuit to realize, the central processing circuit 130 of alternating voltage pick-up unit 100 can also comprise internal memory.
Alternating voltage pick-up unit 100 can be by various hardware (analog to digital converter, marginal detector, central processing unit etc.) constituent apparatus, also can be realized by single-chip microcomputer.For example but be not used in restriction, can adopt single-chip microcomputer NEC upd78F9202 to measure the output voltage of generator 200, realize monitoring voltage.Fig. 5 is a upd78F9202 single chip circuit block diagram; This single-chip microcomputer is compared with other model single-chip microcomputer, and maximum advantage is the cost performance superelevation, is particularly suitable for being applied to generator voltage monitoring field; The encapsulation of 10 PIN pin is from volume and application function, and is all just right.With reference to figure 3 and Fig. 5, except 3 pin and 4 pin as power supply, 6 pin and 7 pin are as input pin, and other pin is as output pin.Wherein, 6 pin are used to gather the voltage magnitude of adjustment circuit 300 outputs, and the digital quantity that can directly handle through the built-in analog-to-digital conversion module program of being converted into; 7 pin detect the square-wave signal of comparator circuit 400 outputs through the built-in edge detection module of single-chip microcomputer; Six remaining pins can connect 6 LED lamps, through lighting the LED lamp of various combination, tell the electric pressure that the user is current.6 LED lamps reach 64 kind (2
6) combination, can the 0V-380V voltage range be divided into 64 electric pressures (can be self-defined according to the actual requirements) at most.When adopting the upd78F9202 single-chip microcomputer to realize ac voltage measurement device 100; All modules that ac voltage measurement device 100 is comprised among Fig. 3 are the build-in function of upd78F9202 single-chip microcomputer, and this improvement project can realize economy and functional optimum combination.
Fig. 6 is the workflow diagram of the alternating voltage pick-up unit 100 of the utility model; When alternating voltage pick-up unit 100 is realized by single-chip microcomputer; Fig. 6 is a single-chip microcomputer backstage main program flow chart; Referring to Fig. 3 and shown in Figure 6, the step of the alternating voltage that alternating voltage pick-up unit 100 survey frequencies are variable comprises:
SA, at first accomplish system initialization work;
Whether SB, edge detection module 120 polls detect the negative edge of square-wave signal, up to inquiring negative edge, show that a new voltage cycle begins, output cyclomorphosis signal;
SC, central processing circuit 130 receive said cyclomorphosis signal; G_sampleFlag judges whether it is gathering voltage magnitude through the sampling zone bit; Zone bit g_sampleFlag is that 0 expression system has just accomplished initialization or the firm magnitude of voltage that finishes one-period calculates, execution in step SD if sample; If sampling zone bit g_sampleFlag is that 1 expression system is according to sampling time interval (during chip microcontroller, for according to interrupt routine) sampled voltage amplitude, execution in step SE;
SD, central processing circuit 130 enable sampling and interrupt, and to put sampling zone bit g_sampleFlag be 1, according to sampling time interval sampled voltage amplitude, execution in step SF;
SE, central processing circuit 130 stop sampling interrupting, and to put end cycle zone bit g_oneCycleEnd be 1;
SF, central processing circuit 130 judge whether a voltage cycle finishes; The value of its polling cycle end mark position g_oneCycleEnd; When end cycle zone bit g_oneCycleEnd was 1, central processing circuit 130 was known magnitude of voltage, the execution in step SG that intactly collects a voltage cycle; If end cycle zone bit g_oneCycleEnd is 0 o'clock, execution in step SB;
SG, central processing circuit 130 be according to the magnitude of voltage calculating voltage mean value that collects in the voltage cycle, and drive a plurality of LED lamps 500 and demonstrate corresponding electric pressure, and it is 0 that sampling zone bit g_sampleFlag is set at last, gets back to step SB.
Should be noted that among the step SD that central processing circuit 130 is according to sampling time interval sampled voltage amplitude; Execution in step SF; Central processing circuit 130 judges whether a voltage cycle finishes, and when end cycle zone bit g_oneCycleEnd is 0 (voltage cycle does not finish), execution in step SB; In this process; Central processing circuit 130 is always according to sampling time interval sampled voltage amplitude, and detection module 120 detects negative edge again up to the edge, and promptly central processing circuit 130 receives that once more the cyclomorphosis signal needs to stop sampling and interrupts to judge.
The process flow diagram that Fig. 7 enables to sample and interrupts for central processing circuit 130, as shown in Figure 7, in step SD, the central processing circuit 130 interrupt run flow process that enables to sample is:
SD1, central processing circuit 130 enable sampling and interrupt;
SD2, central processing circuit 130 judge whether current number of samples has exceeded the maximum number of samples of its internal memory restriction; If not then carry out SD3; If exceed the maximum hits (the maximum hits that central processing circuit 130 its internal memories can be stored) of permission then directly finish sampling this time (during chip microcontroller, then being :) if exceed the maximum hits of permission then directly withdraw from interrupt routine;
SD3, central processing circuit 130 are sampled according to predetermined sampling time interval, read the analog to digital conversion result of current alternating voltage and preserve record sampled point quantity.
Carry out step SF shown in Figure 6 behind the step SD3.
Fig. 8 is the system chart of second embodiment of system of the variable alternating voltage of the survey frequency of the utility model; As shown in Figure 8; In the present embodiment; Central processing circuit 130 comprises the timing circuit 131 that is preset with sampling time interval, and receive that said cyclomorphosis signal enables regularly to decide road 131, the magnitude of voltage of the alternating current in the said sampling time interval sampling current period that provides according to timing circuit 131 after the analog to digital conversion is with the central processing unit 132 of the average voltage level in the calculating current period.
In the present embodiment, all the other situation are identical with first embodiment of the system of the utility model, repeat no more at this.
Fig. 9 is the system chart of the 3rd embodiment of system of the variable alternating voltage of the survey frequency of the utility model; As shown in Figure 9; In the present embodiment; Central processing circuit 130 also comprises the memory module 133 that is internal or external at central processing unit 132, and memory module 133 can be used for the data that collect in the whole voltage measurement, the data that calculate are stored.
In the present embodiment, all the other situation are identical with second embodiment of the system of the utility model, repeat no more at this.
Figure 10 is the system chart of the 4th embodiment of system of the variable alternating voltage of the survey frequency of the utility model; Shown in figure 10; In the present embodiment, central processing unit 132 also comprises and judges whether current number of samples exceeds the judge module 1321 of the maximum number of samples that its internal memory can store.
In the present embodiment, all the other situation are identical with the 3rd embodiment of the system of the utility model, repeat no more at this.
In concrete implementation process, can carry out suitable improvement to the device and the system of the variable alternating voltage of the survey frequency of the utility model; To adapt to the specific requirement of concrete condition; And the technical characterictic of each embodiment can use separately in the utility model, also can make up use.Therefore be appreciated that the embodiment according to the utility model just plays exemplary role, is not limited to the protection domain of the utility model.