Abstract:
A voltage measuring circuit includes a rectifier to receive an alternating current (AC) voltage to be measured and to provide a rectified output; a comparator for comparing the rectified output and producing therefrom a square wave having a pulse width indicative of the rectified output exceeding a threshold; a calculation circuit for converting a measurement of the pulse width into a measurement of the voltage and optionally an opto-isolator interconnecting the comparator to the calculation circuit. The rectifier may provide operating power to the comparator and an input side of the opto-isolator, from the AC voltage signal being measured. The remainder of the measuring circuit may powered by a source isolated from the voltage to be measured.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    The present application claims priority from U.S. Provisional Patent Application No. 61/577,303, filed Dec. 19, 2011 the contents of which are hereby incorporated by reference. 
     
    
     FIELD OF THE INVENTION 
       [0002]    The present invention relates generally to electronic measurement, and more particularly to voltage measuring circuits, suitable for measuring root-mean square voltages and other metrics of a time varying voltages. 
       BACKGROUND OF THE INVENTION 
       [0003]    Many practical applications require measuring the magnitude of an AC voltage signal. 
         [0004]    For example, universal power supplies (UPS) often measure source voltages with great precision. Likewise alarm systems often monitor AC mains to sense power outages. 
         [0005]    Typical techniques require the AC voltage signal to be sampled continuously. From the sampling, the zero crossing of the assessed may be assessed and a root-mean-square (RMS) voltage value may be calculated as the square root of the arithmetic mean of the squares of the sampled values. Alternatively, for known periodic waveforms, the peak value of the signal may be assessed, and an RMS voltage may be calculated—for example for a perfectly sinusoidal signal, the RMS voltage may be calculated as the peak voltage divided by the square root of two (√2). Yet other techniques involve rectifying the AC voltage signal and filtering the resulting rectified signal as a proxy for the amplitude of the AC voltage signal. 
         [0006]    Typical measuring circuits include a voltage divider used to sample the AC voltage signal of interesting. However, isolating the measuring circuit from the remainder of the circuit proves to be costly, and is usually accomplished using an isolation transformer, or an analog to digital converter, powered by an isolated power source. 
         [0007]    Accordingly, there is a need for a new AC voltage measurement circuit that may be more inexpensively isolated, and method. 
       SUMMARY OF THE INVENTION 
       [0008]    Exemplary of an embodiment of the invention, a voltage measuring circuit includes a rectifier to receive an alternating current (AC) voltage to be measured and to provide a rectified output; a comparator for comparing the rectified output and producing therefrom a square wave having a pulse width indicative of the rectified output exceeding a threshold; a calculation circuit for converting a measurement of the pulse width into a measurement of the voltage and optionally an opto-isolator interconnecting the comparator to the calculation circuit. The rectifier may provide operating power to the comparator and an input side of the opto-isolator, from the AC voltage signal being measured. The remainder of the measuring circuit may powered by a source isolated from the voltage to be measured. 
         [0009]    In accordance with an aspect of the present invention, there is provided method of measuring the magnitude of an AC voltage signal. The method comprises: rectifying the AC voltage signal to provide a rectified output; comparing the rectified output and producing therefrom a square wave having a pulse width indicative of the rectified output exceeding a threshold; converting a measurement of the pulse width into a measurement of the magnitude of the AC voltage signal. 
         [0010]    Other aspects and features of the present invention will become apparent to those of ordinary skill in the art upon review of the following description of specific embodiments of the invention in conjunction with the accompanying figures. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0011]    In the figures which illustrate by way of example only, embodiments of the present invention, 
           [0012]      FIG. 1  is a graph of a sinusoidal wave form corresponding to an input voltage; 
           [0013]      FIG. 2  is a block diagram of a voltage measuring circuit, exemplary of an embodiment of the present invention; 
           [0014]      FIGS. 3A and 3B  are block diagrams of possible calculation circuits used in the voltage measuring circuit of  FIG. 2 ; 
           [0015]      FIGS. 4A ,  4 B and  4 C are graphs of waveforms formed by the measuring circuit of  FIG. 2 ; and 
           [0016]      FIG. 5  is a schematic diagram of a voltage measuring circuit, exemplary of an embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION 
       [0017]      FIG. 2  illustrates an exemplary voltage measuring circuit  10 , capable of measuring the magnitude of an alternating current (AC) voltage source  12  that provides a sinusoidal voltage V IN , as for example depicted in  FIG. 1 . As illustrated in  FIG. 1 , source  12  provides a voltage V IN  that is sinusoidal having an amplitude V pk , at a frequency of 1/T f  (where T f  is the period of the sinusoid). 
         [0018]    As illustrated in  FIG. 2 , voltage measuring circuit  10  includes a full wave bridge rectifier  18  that receives V IN  from source  12  and provides a full-wave rectified output V RECT , as depicted in  FIG. 4A . 
         [0019]    The output of rectifier  18  is provided to a voltage divider  20  and the output of rectifier  18  is further used to power downstream components, as detailed below. 
         [0020]    Voltage divider  20  includes resistor R 3    30  and resistor R 6    32  that provide fractional voltage 
         [0000]    
       
         
           
             
               
                 R 
                 6 
               
               
                 
                   R 
                   3 
                 
                 + 
                 
                   R 
                   6 
                 
               
             
             . 
           
         
       
     
         [0000]    V RECT  to the input of a comparator  22 . 
         [0021]    Comparator  22  may be formed using a conventional operational amplifier  24  whose inverting input is driven by a reference source  36 , that provides a reference DC voltage V i . The non-inverting input of operational amplifier  24  acts as the input to comparator  22  that receives the divided voltage 
         [0000]    
       
         
           
             
               
                 V 
                 COMP 
               
               = 
               
                 
                   
                     
                       R 
                       6 
                     
                     
                       
                         R 
                         3 
                       
                       + 
                       
                         R 
                         6 
                       
                     
                   
                   · 
                   
                     V 
                     RECT 
                   
                 
                 = 
                 
                   
                     1 
                     K 
                   
                   · 
                   
                     V 
                     RECT 
                   
                 
               
             
             , 
             
               
 
             
              
             where 
           
         
       
       
         
           
             
               K 
               = 
               
                 
                   
                     R 
                     3 
                   
                   + 
                   
                     R 
                     6 
                   
                 
                 
                   R 
                   6 
                 
               
             
             , 
           
         
       
     
         [0000]    as depicted in  FIG. 4B   
         [0022]    As will be appreciated, the output of amplifier  24  acts as a comparator output that drives opto-isolator  28 . The output of comparator  22  will be high any time V COMP   
         [0000]    
       
         
           
             ( 
             
               
                 i 
                 . 
                 e 
                 . 
                 
                     
                 
                  
                 
                   
                     R 
                     6 
                   
                   
                     
                       R 
                       3 
                     
                     + 
                     
                       R 
                       6 
                     
                   
                 
               
               · 
               
                 V 
                 RECT 
               
             
             ) 
           
         
       
     
         [0000]    equals or exceeds V 1 , and low otherwise, as depicted in  FIG. 4B . The resulting output of comparator  22  drives opto-isolator  28 . The output of opto-isolator  28  will be a pulse-width modulated (PWM) square wave, of period T f , as depicted in  FIG. 4C . The width u of the square wave (i.e. the time the output of comparator  22  is high) is dependent on the frequency and amplitude of V IN . 
         [0023]    As such, the output of opto-isolator  28  may be provided to a calculation circuit  16  that may translate the width of the PWM square wave to a signal representative of the magnitude of AC voltage source  12 , measured for example as a peak or RMS voltage, and optionally the frequency of V IN . As well, the absence of a square wave output voltage at opto-isolator  28  may be interpreted as low or no output voltage fault or condition. 
         [0024]    Specifically, the output of operational amplifier  24  drives opto-isolator  28  through resistor  26 . Now, by measuring the width u of the square wave, it is possible to determine V pk  and/or the RMS voltage (V RMS ) of source  12 , and/or the frequency of V IN . 
         [0025]    In particular, as illustrated in  FIG. 4B , the input to comparator  22  may be expressed as: 
         [0000]    
       
         
           
             
               
                 
                   
                     V 
                     COMP 
                   
                   = 
                   
                     
                       V 
                       i 
                     
                     = 
                     
                       
                         
                           V 
                           
                             p 
                              
                             
                                 
                             
                              
                             k 
                           
                         
                         K 
                       
                       · 
                       
                          
                         
                           sin 
                            
                           
                             ( 
                             
                               ω 
                                
                               
                                   
                               
                                
                               
                                 t 
                                 0 
                               
                             
                             ) 
                           
                         
                          
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where t o  represents the time of intersection of V IN  and V i . 
         [0026]    From this, V pk  may be determined: 
         [0000]    
       
         
           
             
               
                 
                   
                     V 
                     
                       p 
                        
                       
                           
                       
                        
                       k 
                     
                   
                   = 
                   
                     
                       K 
                       · 
                       
                         V 
                         i 
                       
                     
                     
                        
                       
                         sin 
                          
                         
                           ( 
                           
                             2 
                              
                             π 
                              
                             
                               
                                 1 
                                 
                                   T 
                                   f 
                                 
                               
                               · 
                               
                                 t 
                                 0 
                               
                             
                           
                           ) 
                         
                       
                        
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0027]    Expressed in terms of u, the width of the PWM square wave (i.e. the time it is on) depicted in  FIG. 4C , 
         [0000]    
       
         
           
             
               
                 
                   
                     V 
                     
                       p 
                        
                       
                           
                       
                        
                       k 
                     
                   
                   = 
                   
                     
                       
                         K 
                         · 
                         
                           V 
                           i 
                         
                       
                       
                          
                         
                           sin 
                            
                           
                             ( 
                             
                               2 
                                
                               
                                 π 
                                 · 
                                 
                                   1 
                                   
                                     T 
                                     f 
                                   
                                 
                                 · 
                                 
                                   u 
                                   2 
                                 
                               
                             
                             ) 
                           
                         
                          
                       
                     
                     = 
                     
                       
                         K 
                         · 
                         
                           V 
                           i 
                         
                       
                       
                          
                         
                           sin 
                            
                           
                             ( 
                             
                               π 
                               · 
                               
                                 u 
                                 
                                   T 
                                   f 
                                 
                               
                             
                             ) 
                           
                         
                          
                       
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0028]    Noting that u may be interrelated to the period of V IN , T f , as: 
         [0000]        T   f =2·( u+w )  (4)
 
         [0000]    where w represents the time the PWM square wave is off. 
         [0029]    Substituting equation (4) into equation (3), yields: 
         [0000]    
       
         
           
             
               
                 
                   
                     V 
                     
                       p 
                        
                       
                           
                       
                        
                       k 
                     
                   
                   = 
                   
                     
                       K 
                       · 
                       
                         V 
                         i 
                       
                     
                     
                        
                       
                         sin 
                          
                         
                           ( 
                           
                             π 
                             · 
                             
                               u 
                               
                                 2 
                                 · 
                                 
                                   ( 
                                   
                                     u 
                                     + 
                                     w 
                                   
                                   ) 
                                 
                               
                             
                           
                           ) 
                         
                       
                        
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0030]    For a sine wave, the RMS voltage may be calculated from V pk  by observing, 
         [0000]    
       
         
           
             
               
                 
                   
                     V 
                     
                       RM 
                        
                       
                           
                       
                        
                       S 
                     
                   
                   = 
                   
                     
                       
                         V 
                         
                           p 
                            
                           
                               
                           
                            
                           k 
                         
                       
                       
                         2 
                       
                     
                     = 
                     
                       
                         K 
                         · 
                         Vi 
                       
                       
                         
                           2 
                         
                         · 
                         
                            
                           
                             sin 
                              
                             
                               ( 
                               
                                 π 
                                 · 
                                 
                                   u 
                                   
                                     2 
                                     · 
                                     
                                       ( 
                                       
                                         u 
                                         + 
                                         w 
                                       
                                       ) 
                                     
                                   
                                 
                               
                               ) 
                             
                           
                            
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0031]    The output of opto-isolator  28  may feed an input to a processing/calculation circuit  16 . In one embodiment, calculation circuit  16  may take the form of a processor  42 , in the form of a controller, microprocessor, digital signal processor (DSP) or the like, under program control, as depicted in  FIG. 3A . 
         [0032]    Processor  42  may sample the output of opto-isolator  28  to determine values of w and u. For example, the processor  16  may sample the output of opto-isolator  28  to calculate w and u. For example, processor  16  may calculate the magnitude of the voltage V pk  as 
         [0000]    
       
         
           
             
               K 
               · 
               
                 V 
                 i 
               
             
             
               sin 
                
               
                 ( 
                 
                   π 
                   · 
                   
                     u 
                     
                       2 
                       · 
                       
                         ( 
                         
                           u 
                           + 
                           w 
                         
                         ) 
                       
                     
                   
                 
                 ) 
               
             
           
         
       
     
         [0000]    or the RMS voltage V RMS  as 
         [0000]    
       
         
           
             
               
                 K 
                 · 
                 
                   V 
                   i 
                 
               
               
                 
                   2 
                 
                 · 
                 
                   sin 
                    
                   
                     ( 
                     
                       π 
                       · 
                       
                         u 
                         
                           2 
                           · 
                           
                             ( 
                             
                               u 
                               + 
                               w 
                             
                             ) 
                           
                         
                       
                     
                     ) 
                   
                 
               
             
             . 
           
         
       
     
         [0033]    Typically, an average V RMS  value is of interest. The average may be determined as the sum of RMS values during n cycles divided by n. 
         [0034]    That is, the average RMS voltage may be determined as: 
         [0000]    
       
         
           
             = 
             
               
                 
                   1 
                   n 
                 
                 · 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     n 
                   
                    
                   
                       
                   
                    
                   
                     
                       K 
                       · 
                       
                         V 
                         i 
                       
                     
                     
                       
                         2 
                       
                       · 
                       
                         sin 
                          
                         
                           ( 
                           
                             π 
                             · 
                             
                               
                                 u 
                                  
                                 
                                   [ 
                                   i 
                                   ] 
                                 
                               
                               
                                 2 
                                 · 
                                 
                                   ( 
                                   
                                     
                                       u 
                                        
                                       
                                         [ 
                                         i 
                                         ] 
                                       
                                     
                                     + 
                                     
                                       w 
                                        
                                       
                                         [ 
                                         i 
                                         ] 
                                       
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                           ) 
                         
                       
                     
                   
                 
               
                
               
                 
 
               
               = 
               
                 
                   ∑ 
                   
                     i 
                     = 
                     1 
                   
                   n 
                 
                  
                 
                     
                 
                  
                 
                   
                     K 
                     · 
                     
                       V 
                       i 
                     
                   
                   
                     
                       2 
                     
                     · 
                     n 
                     · 
                     
                       sin 
                        
                       
                         ( 
                         
                           π 
                           · 
                           
                             
                               u 
                                
                               
                                 [ 
                                 i 
                                 ] 
                               
                             
                             
                               2 
                               · 
                               
                                 ( 
                                 
                                   
                                     u 
                                      
                                     
                                       [ 
                                       i 
                                       ] 
                                     
                                   
                                   + 
                                   
                                     w 
                                      
                                     
                                       [ 
                                       i 
                                       ] 
                                     
                                   
                                 
                                 ) 
                               
                             
                           
                         
                         ) 
                       
                     
                   
                 
               
             
           
         
       
     
         [0035]    Circuit  14  may perform the calculation above. For convenience, V i  may be arbitrarily chosen based on the operating voltage of amplifier  24 . V i  is typically chosen as less than the operating voltage. In the depicted embodiment, V i  may be chosen as 1.24V, which is a typical reference voltage. Now, K will need to be chosen based on the minimum voltage to be measured. That is, KV i  should be chosen to be less than or equal to the minimum voltage to be measured. If, for example, the lowest V RMS  to be measured V RMS     —     min =57 V (corresponding to a lowest contemplated V RMS  of 57 V), K may be chosen as V RMS     —     min /V i =57/1.24=45.9677. 
         [0036]    Additionally or alternatively, the calculation may be simplified to reduce the number of multiplications and divisions performed. This may, for example, be done by choosing a specific number of samples (n), based on the chosen values of V i  and K, and adjusting K as required. That is, for any particular chosen V i , n may be chosen as an integer approximation of K/√2. This simplification helps when calculating the RMS averaging. If a proper n and K are chosen, the averaging operation may be reduced to a summing operation instead of summing and division. However, this is only to decreases the required computational power. 
         [0037]    That is, for the example minimum detection of V RMS  of 57V, and V i  chosen as 1.24 V, and K=45.9677, a choice of n around 32.5 would reduce multiplication/division. This choice of n and K eliminates the need to multiply and divide. The number of samples (represented by the integer value of “n”) determines how many samples must be added together to produce an average value of the input RMS voltage 
         [0038]    However, as n represents the number of samples, n must be an integer. Thus n may be chosen as n=32 (related to averaging of 32 samples). K may in turn be adjusted/chosen to be K=√{square root over (2)}·32=45.2548. Put another way, to simplify division and multiplication, choice of K and n may be made such that the ration of K/√(2·n) equals one (1) or some other integer. 
         [0039]    In turn, R 3  and R 6  may be chosen as 
         [0000]    
       
         
           
             
               
                 
                   
                     R 
                     3 
                   
                   + 
                   
                     R 
                     6 
                   
                 
                 
                   R 
                   6 
                 
               
               = 
               45.2548 
             
             , 
           
         
       
     
         [0000]    using standard available resistor values. 
         [0040]    Continuous sampling over multiple cycles may be averaged to determine the average RMS voltage. 
         [0041]    Conveniently, processing/calculation circuit  16  may further determine AC frequency, and/or a fault condition. For example, processing/calculation circuit  16  may monitor the output of opto-isolator  28  for each cycle to assess a fault. For example, if the output remains in high impedance (or logic high, if biased) for half of an AC cycle (i.e. no square wave output), a fault may be sensed, and optionally signalled. Likewise the AC frequency of V IN  may be sensed as 
         [0000]    
       
         
           
             
               frequ 
               . 
             
             = 
             
               
                 1 
                 
                   2 
                   · 
                   
                     ( 
                     
                       u 
                       + 
                       w 
                     
                     ) 
                   
                 
               
               . 
             
           
         
       
     
         [0042]    Processor  42  may provide separate digital outputs V out , FREQU_OUT, FAULT_OUT, indicative of measured voltage, frequency or generate a fault flag. 
         [0043]    Rectifier  18  ( FIG. 2 ) may further provide the operating current/voltage to comparator  22 , and opto-isolator  28 . As such, in the depicted embodiment circuit  10  components on the input side of opto-isolator  28  do not need to share a power supply with processing/calculation circuit  16 . 
         [0044]    Circuit  14  may be formed using discrete or integrated components, or possibly using one or more microcontrollers, digital signal processors (DSPs), or a combination thereof. 
         [0045]      FIG. 5  illustrates an example circuit  14  formed using four diodes arranged as bridge rectifier  18 . Voltage divider  20  is formed from resistors R 3  and R 6 . Comparator  22  (including a reference source) may be formed using from two resistors R 4 , R 5  and a controllable Zener diode U 2 . A depletion mode MOSFET Q 1 , the resistor R 1 , the capacitor C 1  and fixed value zener diode D 2 , bias the comparator  22  and opto-isolator  28 . Opto-isolator  28  may be a standard opto-coupler such as 4N31 or 4N32 six pin packaged opto-coupler. Q 1  and R 1  form a constant current source that charges C 1  which supplies energy around the input voltage zero crossing, when diodes of rectifier  18  do not provide supply current. D 2  limits the bias voltage across the comparator, U 2  (the controllable zener diode U 2  is used as comparator). The resistor R 4  is used to bias U 2  and R 5  to limit the current through the LED of opto-coupler  28 . 
         [0046]    Conveniently, the circuit of  FIG. 5  uses relatively few components and may be produced at a low cost. It further provides for isolation between the power supply used to provide power to controller  16 , and the voltage being measured. Moreover, the output of circuit  14  may easily feed controller  16  or another DSP or processor, using, for example a general purpose I/O (GPIO) pin. 
         [0047]    In an alternative embodiment, processing/calculation circuit  16  may take the form of an integrator as depicted in  FIG. 3B . In particular, the ratio u/(u+w) represents the duty cycle of the output signal of opto-isolator  28 , with a fixed frequency 1/(u+w). As such, the output of opto-isolator  28  may be integrated to form a signal proportional to the AC input voltage. A suitable integrator may be formed using a conventional operational amplifier  38 , a capacitor  34  and a resistor  32 . A further resistor  31  may bias the output of opto-isolator  28 . The integrator may integrate the waveform of  FIG. 4C  over multiple cycles, and thereby present an average analog voltage signal proportional to u. Proper choice of values for capacitor  34  and resistor  32  allow amplifier  38  to output a bounded voltage proportional to V pk  and V RMS    
         [0048]    Of course, the above described embodiments are intended to be illustrative only and in no way limiting. The described embodiments of carrying out the invention are susceptible to many modifications of form, arrangement of parts, details and order of operation. The invention, rather, is intended to encompass all such modification within its scope, as defined by the claims.