Abstract:
Early power failure (EPF) detection circuit applies a rectified, unfiltered periodic waveform, at the frequency of the mains supply voltage to a threshold detector. During each cycle of the periodic waveform, the threshold detector produces a pulse voltage having a leading edge when the periodic waveform begins to exceed a threshold level associated with the threshold detector and a trailing edge when the periodic waveform ceases to exceed the threshold voltage. A microprocessor measures the length of the interval between the leading and trailing edges for indirectly measuring the magnitude (for example, RMS or peak) of the mains supply voltage. When the indirectly measured magnitude decreases below a minimum permissible, second threshold magnitude, a controlled power shutdown of the apparatus is initiated, such as by, for example, programs interrupt routine in the microprocessor.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates to a power disturbance detection circuit in power supplies energized by an alternating current (AC) voltage source for providing power to electronic and electrical devices. 
       BACKGROUND OF THE INVENTION 
       [0002]    Personal video recorders, set-top boxes, personal computers, etc. typically employ various memory devices to store program and system information. Memory devices include hard disk drives, recordable disks, semiconductor memory devices and the like. Set-top boxes, for example, require a sufficient time to provide orderly shutdown such that data can be saved in a non-volatile memory such as Flash memory device before the supply voltage drops to such a low level that saving the data can no longer be accomplished. 
         [0003]    AC power sources that power such devices can suffer from a variety of long-term and transient disturbances or power fail conditions. The term “power disturbance” or “power fail condition”, as used herein, refers to a condition in which a magnitude of an AC input supply voltage is smaller than required to be within a normal range of values, a condition that might necessitate performing an orderly shutdown of the device. 
         [0004]    In order to guarantee the necessary time for the orderly shutdown, a voltage that is indicative of the AC mains supply voltage is monitored. An early power fail (EPF) threshold voltage is chosen such that the magnitude of the AC mains supply voltage is higher than a minimum required to operate direct current (DC) power supplies in, for example, the set-top box. The set-top box DC power supplies have to remain active long enough after EPF threshold voltage is detected to enable sufficient time for performing orderly shutdown. 
         [0005]    It might also be desirable to allow uninterrupted operation, during brown out conditions, when the AC voltage is too small to be within the normal tolerance or range but is greater than what the set-top box actually needs for uninterrupted normal operation. 
         [0006]    In a prior art arrangement, a threshold detector provides an output signal indicating that the AC mains supply voltage has exceeded, during a portion of a given period of the AC mains supply voltage, a threshold magnitude. This situation is considered to be an undisturbed AC mains supply voltage. Conversely, the detector output signal would indicate a disturbance or power failure in the AC mains supply voltage, when the AC mains supply voltage exceeds the threshold magnitude, at no time throughout the entire period. 
         [0007]    Typically an electrolytic capacitor is used to maintain sufficient amount of stored charge for use between the time the EPF threshold is detected and the time when the orderly shutdown is completed. Because of conditions such as tolerances, variation in thresholds due to loading, etc., either the EPF threshold voltage has to be set higher or a larger value electrolytic capacitor value has to be chosen than would be, otherwise, necessary. This has to be done so that orderly shutdown can be guaranteed under all such conditions. 
         [0008]    In the prior art arrangement, there is a range of values of the AC mains supply voltage that will exceed, during a portion of a given period of the AC mains supply voltage, the threshold magnitude. Because the actual magnitude of the AC mains supply voltage is not measured, the threshold magnitude has to be set in a manner to meet the worst case condition. Consequently, the threshold magnitude has to be set, disadvantageously, at a higher value than if the actual magnitude of the AC mains supply voltage was measured and known. This requires the initiation of the shutdown routine when the magnitude of the AC mains supply voltage is, disadvantageously, higher than if the actual magnitude of the AC mains supply voltage was measured and known. 
         [0009]    An EPF detection circuit, embodying an aspect of the invention, applies a rectified periodic waveform that is unfiltered with respect to the frequency of the AC mains supply voltage to a threshold detector. In contrast to the prior art, both when the magnitude (for example, RMS or peak) of the AC mains supply voltage is at an acceptable magnitude and also when a disturbance occurs, the inventive detector detects, during each period, a time when the increasing waveform crosses a threshold magnitude in a first direction and a time when the decreasing waveform crosses a threshold level in an opposite direction. A time measuring device, for example, a microprocessor, measures a length of an interval between threshold crossing times; alternatively, it calculates a duty cycle of an output signal of the threshold detector. Each of those results is indirectly indicative of a magnitude (for example, RMS or peak) of the mains supply voltage. A larger duty cycle or a longer length would be indicative of a higher magnitude and vice versa. Based on the result of the indirectly measured magnitude, the microprocessor can initiate and perform orderly controlled power shutdown of the apparatus by, for example, program interrupt routine. Because of the indirect measurement of the actual magnitude (for example, RMS or peak) of the AC mains supply voltage, the threshold magnitude for shutdown can be established at, advantageously, a lower magnitude of the AC mains supply voltage than required in the prior art. By accurately indirectly monitoring the magnitude of the AC mains supply voltage, the set-top box can continue uninterrupted operation with, advantageously, lower magnitudes of AC mains than would be required in the prior art power supply prior to initiating shutdown. It will also provide the flexibility to operate, for example, the set-top box during, advantageously, longer intervals of AC dropout, during which the disturbance occurs in only a limited number of periods of the AC mains supply voltage. 
       SUMMARY OF THE INVENTION 
       [0010]    An apparatus, embodying an inventive feature, for generating an early power failure (EPF) indicative signal for an electronic device energized by an alternating current (AC) input mains voltage includes a threshold detector. The threshold detector is responsive to the AC input mains voltage for generating an output signal when, during a portion of a period of the AC input mains voltage, an instantaneous magnitude of the AC input mains voltage exceeds a threshold of the detector. The corresponding portion occurs both when the AC input mains voltage is within a normal operation range and when a power failure condition occurs in the AC input mains voltage. A processor measures a value indicative of a length of the portion period of the detector output signal for providing the EPF indication in accordance with the length indicative value. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0011]      FIG. 1  illustrates partially in a block diagram form and partially in detailed schematic a power supply that energizes an electrical device and a power disturbance detection circuit according to an embodiment of the invention; and 
           [0012]      FIGS. 2   a ,  2   b  and  2   c  illustrate waveforms for explaining the operation of the power disturbance detection circuit of  FIG. 1 . 
       
    
    
     DETAILED DESCRIPTION 
       [0013]      FIG. 1  illustrates partially in a block diagram form and parially in detailed schematic a power supply  100  that energizes an electrical device. It also illustrates a power disturbance or early power failure (EPF) detection circuit  200  according to an embodiment of the invention. EPF detection circuit  200  detects power disturbance in an alternating current (AC) mains supply voltage source  105  that provides an input supply voltage Vac to power supply  100 . 
         [0014]      FIGS. 2   a ,  2   b  and  2   c  illustrate waveforms for explaining the operation of EPF detection circuit  200 . Similar symbols and numerals in  FIGS. 1  and  FIGS. 2   a - 2   c  indicate similar items or functions. 
         [0015]    Power supply  100  of  FIG. 1  includes a conventional full-wave bridge rectifier formed by a rectifier D 101  having an anode that is coupled to a terminal  105   a  of voltage source  105  for rectifying a positive portion Vac 1  of voltage Vac of  FIG. 2   a . A terminal  105   b  of voltage source  105  of  FIG. 1  is coupled to an anode of a rectifier D 102  having a cathode that is coupled to the cathode of diode D 101  for rectifying a negative portion Vac 2  of voltage Vac of  FIG. 2   a . A junction terminal between the cathodes of rectifiers D 101  and D 102  of  FIG. 1  is coupled to a conventional power supply converter  500 , such as a switch mode power supply, not shown in details, that generates supply voltages, some of them not shown, for energizing, for example, a set-top box, not shown. A common or ground terminal  300  of power supply converter  500  is coupled to an anode of a rectifier D 104  of the bridge rectifier having a cathode that is coupled to terminal  105   b . Ground terminal  300  is coupled to an anode of a rectifier D 103  of the bridge rectifier having a cathode that is coupled to terminal  105   a.    
         [0016]    In EPF detection circuit  200  of  FIG. 1 , terminal  105   a  of source  105  is coupled to an anode of a rectifier D 406  having a cathode that is coupled to a terminal  110   a  for rectifying positive portion Vac 1  of voltage Vac of  FIG. 2   a . Terminal  105   b  of  FIG. 1  of voltage source  105  is coupled to an anode of a diode D 405  having a cathode that is coupled to junction terminal  110   a  at the junction of the cathode of diodes D 406  and D 405  for rectifying negative portion Vac 2  of voltage Vac of  FIG. 2   a . As a result, a full-wave rectified periodic waveform  110   b  of  FIG. 1  is developed at twice the frequency, 60×2=120 Hz, of voltage Vac that is unfiltered with respect to the 60 Hz frequency of AC mains supply voltage Vac. Periodic waveform  110   b  is coupled via a voltage divider formed by a resistor R 401  coupled in series with a resistor R 402  to develop at a junction terminal  110   c  of resistors R 401  and R 402  a periodic waveform  110   d  that is the voltage divided portion of waveform  110   b.    
         [0017]    A capacitor C 401  of  FIG. 1  that is coupled in parallel with resistor R 402  provides high frequency filtering having no effect on periodic waveform  110 d because its frequency, 120 Hz, is much lower. A zener diode D 401  coupled in parallel with resistor R 402  provides overvoltage protection at input terminal  110   c  of a comparator  400 , formed in this case by a shunt regulator integrated circuit TL 431  having a threshold level of 2.5V. An output terminal  110   e  of comparator  400  is coupled to a cathode of a diode D 201  of an opto-coupler  112 . A resistor R 203  coupled in series with diode D 201  applies a supply voltage +VDD−IC (in this example 12V) to an anode of diode D 201  for producing a current in diode D 201  when diode D 201  is forward biased. Voltage +VDD−IC is produced by the power supply  500  and can be any convenient voltage. 
         [0018]      FIG. 2   b  illustrates two examples of waveform  110   d  at different amplitudes, waveform  110   d   1  and  110   d   2 , in which waveform  110   d   1  is larger than waveform  110   d   2 . The ratio between the values of resistors R 401  and R 402  of  FIG. 1  is selected so that when voltage Vac of  FIG. 2   a  is at a nominal magnitude of 120V, the instantaneous voltage of waveform  110   d   1  of  FIG. 2   b , midway between 0V and the peak voltage of waveform  110   d   1 , is at 2.5V, the threshold level of comparator  400  of  FIG. 1 . 
         [0019]    At time t 1  of a given period T of  FIG. 2   b , waveform  110   d   1  exceeds and, therefore, crosses the 2.5V threshold of comparator  400  of  FIG. 1  in one direction. Consequently, comparator  400  output terminal  110   e  forms a current path to turn on diode D 201  and develop a forward voltage V fw  in diode D 201  having a rising edge  600  at time t 1  of  FIG. 2   c  of the waveform of voltage V fw . As a result, transistor Q 301  of  FIG. 1  of opto-coupler  112  is turned on. A collector voltage at a collector terminal of transistor Q 301  will have a transition to approximately 0V. On the other hand, at a time t 2  of period T of  FIGS. 2   a - 2   c , waveform  110   d   1  no longer exceeds and, therefore, crosses the 2.5V threshold of comparator  400  of  FIG. 1  in the opposite direction. Consequently, comparator  400  output terminal  110   e  no longer forms a current path to turn off diode D 201  and develops forward voltage V fw  at 0V across diode D 201 . Thus, voltage V fw  has a falling edge  700  at time t 2  of  FIG. 2   c . As a result, transistor Q 301  of  FIG. 1  of opto-coupler  112  is turned off. A collector voltage at the collector terminal of transistor Q 301  will have a transition to approximately 3.3V by an operation of a pull-up resistor R 301 . Thus, diode D 201  conducts during an interval t 1 -t 2 . The 3.3V supply voltage is typical, but can be another voltage that is compatible with the system logic and microprocessor  300 . 
         [0020]    When, instead of waveform  110   d   1  of  FIG. 2   b , waveform  110   d   2  at the lower amplitude or magnitude is applied, diode D 201  of  FIG. 1  will conduct during an interval t 1 ′-t 2 ′ that is shorter than interval t 1 -t 2 . Similarly, a so-called duty cycle of voltage V fw  of  FIG. 2   c  is smaller when waveform  110   d   2  of  FIG. 2   d  at the lower amplitude is applied. The voltage at the collector terminal of transistor Q 301  of  FIG. 1  is applied to an input of a microprocessor  300  that measures in a conventional manner, for example, the lengths of interval t 1 -t 2  or t 1 ′-t 2 ′ of  FIG. 2   b  or, alternatively, the duty cycle of voltage V fw  of  FIG. 2   c  by, for example, counting clock cycles, not shown. When the length of interval t 1 ′-t 2 ′ of  FIG. 2   b , for example, is too short, microprocessor  300  will determine that a power failure condition occurs in AC input mains voltage Vac of  FIG. 1 . 
         [0021]    For measuring the length of, for example, interval t 1 -t 2  of  FIG. 2   b , microprocessor  300  of  FIG. 1  counts pulses of, for example, a real time clock, not shown, from time t 1 , when edge  600  of  FIG. 2   c  occurs to time t 2 , when edge  700  occurs. Alternatively, microprocessor  300  of  FIG. 1  can include an Input-Output (I/O) device, not shown, that acts as an independent clock pulses counter, not shown. In this case, microprocessor  300  of  FIG. 1  records or initializes the count number contained in such counter when edge  600  of  FIG. 2   c  occurs and then records the count number contained in such counter when edge  700  occurs. The difference between the count numbers corresponds to the length of the interval t 1 -t 2 . Microprocessor  300  of  FIG. 1  can calculate the duty cycle of voltage V fw  of  FIG. 2   c  by dividing the length of interval t 1 -t 2 , as obtained above, by the length of one half of a period which is approximately 8.33 milliseconds for voltage Vac of  FIG. 1  having a frequency of 60 Hz. 
         [0022]    The magnitude (for example, RMS or peak) of mains supply voltage Vac of  FIG. 1  can be obtained by microprocessor  300  using, for example, a look-up table, not shown, containing the corresponding magnitude of voltage Vac for each measured length of interval t 1 -t 2  of  FIG. 2   b  or calculated duty cycle. This look-up table can be obtained by applying known values of voltage Vac of  FIG. 1  and measuring the corresponding lengths of interval t 1 -t 2  of  FIG. 2   b  in microprocessor  300  of  FIG. 1 . Alternatively, this look-up table can be obtained by applying known values of voltage Vac and recording the corresponding calculated duty cycle values of voltage V of  FIG. 2   c  in microprocessor  300  of  FIG. 1 . 
         [0023]    Thus, each of those measurement results is indirectly indicative of a magnitude (for example, RMS or peak) of mains supply voltage Vac of  FIG. 1 . Based on the indirectly measured magnitude of voltage Vac in given period T of  FIG. 2   b  and possibly based on analyzing measurements during each of several periods T of  FIG. 2   b , microprocessor  300  of  FIG. 1  can provide EPF indication in a manner to initiate and perform orderly power shutdown of the, for example, set-top box, not shown, by, for example, programs interrupt routine. By indirectly measuring the actual magnitude (for example, RMS or peak) of mains supply voltage Vac, controlled shutdown could be initiated, advantageously, at a lower magnitude of the AC mains supply voltage Vac of  FIG. 1  than would be required in the prior art. Thus, advantageously, fewer interruptions might occur in the course of operating, for example, the set-top box. By accurately monitoring the magnitude of AC mains supply voltage Vac, it is possible to allow uninterrupted operation, during brown out conditions, when the AC voltage is too small to be within the normal tolerance or range but is greater than what the set-top box that is energized by power supply  500  actually needs for uninterrupted normal operation. 
         [0024]    The same power supply  100  of  FIG. 1  may be compatible to operate with each of mains supply voltage Vac of 110V, 60 Hz and mains supply voltage Vac of 230V, 50 Hz. As explained before, microprocessor  300  can measure the length period T of  FIG. 2   b  to determine whether supply voltage Vac is at 60 Hz or at 50 Hz. This, advantageously, allows for separate look-up tables to be used in the same system for voltage Vac at 60 Hz and for voltage Vac at 50 Hz, respectively, to further optimize the decision of when to initiate the shutdown routine. For example, when supply voltage Vac is at 50 Hz, the period T might be longer than when it is at 60 Hz. For the purpose of insuring that the output supply voltage of power supply  100  of  FIG. 1  will not excessively decrease, during a disturbance, microprocessor  300  might initiate the shutdown routine at a higher voltage Vac than when supply voltage Vac is at 60 Hz. 
         [0025]    With a specific AC voltage Vac applied during factory testing, the duty-cycle or length of interval t 1 -t 2  of  FIG. 2   b  can be preset to account for the forward drops in the rectifier diodes, etc. to further add to the precision of the voltage detector threshold. The alignment value could be stored in Flash or Eeprom non-volatile memory, not shown. A software algorithm would be used to set the minimum required threshold voltage to guarantee the required shutdown time.