Abstract:
Data processing and computer systems require continuous monitoring of the primary alternating current power. A power failure must be detected very quickly (within a fraction of a cycle), so that the contents of a volatile memory can be quickly converted into a nonvolatile form. This must occur before power system storage is expended and control is lost. RMS power direction is developed by the product of voltage and current with an integrated circuit multiplier device. When power fails, the circuit indicates a power flow reversal or power equals zero from the detected system current times voltage factor. A retriggerable one-shot in conjunction with a NAND gate is utilized to detect the instantaneous voltage drop to zero and current reversal in order to energize other circuits to protect such volatile data in the event of a power failure.

Description:
BACKGROUND OF THE INVENTION 
     In a computer system, instructions are carried out within a central processing unit in accordance with programmed instructions and the designed hardware of the unit itself. Due to the inherent operation of storage and other data processing circuitry within a computer system, the data being operated on is in a precarious position in the event of a power loss. In the event of a brownout or power system failure, prior art computer systems would lose certain data within the computer due to the fact that these circuits do not have any inherent storage capability once power is lost. Thus, if a failure occurs, certain important input and/or operating data could be lost in addition to consumption of valuable time during the running of a program in that at subsequent reinstitution of power, the data that has been operated upon will have been lost and subsequent operations may not be valid due to the loss of the data during the power failure. 
     Thus, it would be highly desirable that at the instant or shortly thereafter of the power failure, volatile data within the computer system be immediately stored in a non-volatile storage medium such as magnetic tape, magnetic disc or other storage devices which permanently store data even in the event of a power system failure. 
     OBJECTS OF THE INVENTION 
     An object of the present invention is to protect volatile data within a data processing system in the event of a power failure. Another object of the present invention is to monitor the reversal of current flow from input to output in a system due to a power failure in order to ensure proper system competency upon reinstitution of said power. 
     Another object of the present invention is to detect power system failures within a predescribed amount of time and immediately store volatile data in a non-volatile environment utilizing inherent power storage within the system. 
     It is another object of the present invention to provide a system that will remember certain volatile data during the course of operation and subsequent power failure at the time power is reinstituted to the system. 
     It is another object to monitor the voltage and current input to and output from a computer system to denote the radical changes in the voltage and current at the time of power failure in order to protect volatile data from loss due to said power system failure. 
     Another object of the present invention is to detect during a power system failure, the instantaneous voltage drop to zero and the immediate reversal of current due to said power failure in order to engage certain procedures within the data processing system, utilizing stored power within the system, to immediately store in a non-volatile memory that volatile data which could be lost permanently due to said power failure. 
     SUMMARY OF THE INVENTION 
     The present invention utilizes voltage sense and current sense apparatus in order to detect the power flowing into and out of a computer system. Utilizing operational amplifiers coupled to the input voltage and current sensors, voltage signals are generated in direct relation to the voltage and current signals detected. These voltage signals are multiplied in order to detect the actual power of the system. At system or power failure, a retriggerable one shot is energized in order to detect the reversal of current and the instantaneous dropping to zero of the voltage, wherein in conjunction with a NAND gate, a flip-flop circuit will be set. The change of output signals from the flip-flop can be utilized to further instruct a separate operation to protect the loss of valuable data during the operation of a program within a computer system. 
    
    
     DESCRIPTION OF THE DRAWINGS 
     For a more complete understanding of the invention, as well as other objects and further features thereof, reference may be had to the following detailed description of the invention in conjunction with the drawings wherein: 
     FIG. 1 is a schematic diagram of the primary power fault detection circuit incorporating the principles of the present invention and; 
     FIGS. 2 and 3 are representative diagrams of various signals found in the circuitry of FIG. 1 useful in understanding the various aspects of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     FIG. 1 is a partly schematic, partly block diagram of the circuitry utilized as the primary power fault detector. The voltage input sense line V is coupled to operational amplifier 10 via resistor 12. The other input to the operational amplifier is resistor 14 which is coupled directly to ground. Between the output of the operational amplifier 10 and its input at resistor 12 are limiter diodes 16 and 18. The output of the OP AMP 10 is designated as Signal A on FIG. 2. The current sense Signal I is provided by transformer 22 which is coupled to the input of operational amplifier 20 via resistor 24. The other input to the operational amplifier 20 is resistor 26. Between the resistor 24 and the input to the OP AMP 20 and the output of the OP AMP are limiter diodes 26 and 28. The output of OP AMP 20 is designated as Signal B on FIG. 2. Resistors 12, 14, 24 and 26 are utilized to balance the input to the OP AMPS. That is, the impedance at the inputs of the OP AMPS has to be equal with minimum thermal drift. For a type 741  OP AMP, 10K or 20K resistors are typical. 
     Signal A is then coupled to the X input of multiplier 30. Signal B is coupled to the Y input of multiplier 30. The output of the multiplier, Signal C on FIG. 2, is connected to the cathode of diode 32. The anode of diode 32 is Signal C&#39;, seen on FIG. 3&#39;. Signal C&#39; is connected to the T or trigger input to one-shot 40 and also one input of NAND gate 50. Shown at one-shot 40 are adjustable resistor 42 and capacitor 44 connected to a typical 5 volt supply, which are utilized for setting the time constant, i.e., duration of the output signal of one-shot 40. The output of the one-shot 40 is designated as Signal D found in FIG. 3. Signal D provides the other input to NAND gate 50. The output of NAND gate 50 is designated as Signal E found in FIG. 3. This Signal E provides the set/reset input to flip-flop 60 in FIG. 1. 
     The basic operation of the power fault detector is to detect power flow into and out of the system in actual watts. FIG. 2 shows Signal V which is the representation of the input voltage to the system, which could be, of course, the standard 120 volts alternating current. Curve I in FIG. 2 shows a representative drawing of the current sensed by transformer 22 in FIG. 1. Transformer 22 could be, for example, a transformer with a core and a few thousand turns of wire in the main power cable to the system in which this power fault detector is utilized. The transformer detects the current by means of magnetic coupling through resistor 24 to OP AMP 20. 
     During the normal operation of the system, that is when the system is up and running, the voltage sensed, FIG. 2V, is the normal 60 cycle signal of the standard 120 volt power line. Also, at this time, the current is also following a 60 cycle repetitive pattern, but there is a slight phase shift between the voltage and current in the system due to resistive, inductive and capacitive impedances of the system itself. Thus, FIGS. 2V and 2I are shown slightly out of phase as representing a true condition during the normal operation of the system. Due to forward and reverse biased diodes 16 and 18, the output of OP AMP 10 is Signal A shown on FIG. 2. Depending upon the diodes chosen, the output of OP AMP 10 could be any voltage but for purposes of illustration diodes 16 and 18 could limit the voltage at say 7 volts. Thus, FIG. 2A shows rectangular shaped signals of amplitude plus and minus 7 volts, the zero crossings of FIG. 2A occuring at the signal crossings of the 120 volt power supply signal input at FIG. 2V. Also, diodes 26 and 28 operate in a similar manner giving a plus and minus 7 volt signal, slightly delayed due to the phase shift alluded to previously. Thus, the output of OP AMP 20 is Signal B shown at FIG. 2. 
     Signals A and B are then applied to the X and Y, respectively, inputs of multiplier 30. If there was no phase shift, and power was flowing into the system, the output signal from multiplier 30 would be almost a perfect direct current due to the fact that the multiplier takes the product of its X and Y inputs. That is, a plus times a plus voltage would be a plus voltage, while a minus times a minus voltage would also be a plus indication and thus, in the zero phase shift situation, the output of multiplier 30 would, in fact, be an approximately DC signal. However, inasmuch as there is actually a phase shift in any normal operating system, the output of multiplier 30 would not be a true DC signal. In the embodiment shown, at FIGS. 2A and 2B, the action of multiplier 30 produces a signal shown at FIG. 2C. That is, at the times that the minus 7 voltage of FIG. 2B is multiplied with the plus 7 voltage at FIG. 2A, the output is shown as a positive 49 over 2 signal at FIG. 2C. The 49 over 2 indication is the inherent multiplication factor of the multiplier 30, which could be, for example, a Motorola multiplier MC1494 unit commonly available in the marketplace. However, multiplier 30 has an inherent minus factor in the multiplication of these two signals, the minus 7 times plus 7 voltage, normally producing a minus output, would be a positive output due to the minus multiplication factor of multiplier 30. Thus, while the system is up and running in a normal fashion, FIG. 2C produces rectangular shaped signals as shown in the left side of FIG. 2C. 
     Continuing on through the operation of FIG. 1 in a normal up and running condition, the signals shown in FIG. 2C, as the output of multiplier 30, are applied to diode 32 in the reverse biased position in order to limit the voltage applied to the retrigger circuit 40 and NAND gate 50. Thus, the other side of diode 32 is shown as Signal C&#39; seen at FIG. 3C&#39;. FIG. 3C&#39; is the same as FIG. 2C except for the fact that the amplitude of the signals are now limited at a voltage which could be, for example, five volts depending upon the choice of diode 32. Signal C&#39; is now applied to the input of one-shot 40 and one input of NAND gate 50. The voltage level in FIG. 3C&#39; is shown as 5 volts but it would normally be slightly less than that due to the voltage drop through diode 32. 
     One-shot 40 is triggered by the rising edge of the 5 volt signals shown in FIG. 3C&#39;; and according to the one-shot chosen the output therefrom could be signals varying between plus 0.1 volts and 4.1 volts as shown in FIG. 3D as signal D. Such a one-shot could be a type 9601 commonly available. Typical transistor-transistor-logic (TTL) signals would vary, therefore, between 100 millivolts and a maximum of 4.1 volts. The width of the signals shown in FIG. 3D is shown approximately equal to the width of signals shown in FIG. 3C&#39; but this is for ease of illustration only as by varying resistor 42 in conjunction with capacitor 44 could, if desired, change the width of the signals within the limits of one-shot 40. 
     Signal D and Signal C&#39; are now applied to the inputs of NAND gate 50. Still discussing the system in the up and running situation, the output of NAND gate 50 will be Signal E shown in FIG. 3. This signal will be normally a constant voltage output at approximately 4.1 volts as indicated above for the standard transistor-transistor-logic. This is due to the fact that the one-shot is being triggered at the rising edges of Signal C&#39;. The truth table of a NAND gate indicates a logic one out when the inputs are logic 00, logic 01 and logic 10. Thus even if Signal D is wider, as discussed above, there will not be any instance where Signal C&#39; or Signal D will both be in a logic 1 condition due to the triggering of one-shot 40 at the rising edge of Signal C&#39;. Thus, in the normal operating situation, the output of NAND gate 50 is Signal E, at FIG. 3, at a constant voltage shown as 4.1 volts which continues to maintain flip-flop 60 in one state. The subsequent circuitry coupled to flip-flop 60 monitors this indication indicating a normal operating, i.e., up and running situation. 
     It may be good at this point to reiterate certain inherent facts of the circuit during normal operation. Inasmuch as power flow is detected into the system, an instantaneous signal is developed which is proportional to to volts times amps going into the system. Since there is a normal phase shift between the two signals due to the power factor of the system, as there is a slight phase shift between voltage and current in the system, the voltage and current signals sensed will be slightly out of phase and thus the multiplier will generate signals in proportion to the voltage and current sensed and its phase relationship. Inasmuch as there are no false inputs to the multiplier circuit 30, retriggered one-shot 40 and NAND gate 50 generate the signals shown in FIG. 3 which gives the steady DC output Signal E in FIG. 3. In order to protect the data which may be in volatile storage devices, an instantaneous high speed indication of a power fault is desired. Due to the internal storage of power within the system, the circuit looks for an instantaneous reversal of current due to the cessation of input flow to a reversal of current flowing out of instead of into the system. It is apparent, therefore, that the present invention has applicability not only to computer and data processing systems, but to any system where quick action is necessary at the initial stages of power interruption. 
     The current reversal situation would occur, for example, if the input power to the system was terminated due to a power failure, such as one undetermined due to the power company, or as simple as human intervention by turning off the power switch or an accidental removal of the power cord from a power source. The input voltage would then go instantaneously to zero or at least pretty close thereto, in the milli-second range, at least faster than a quarter cycle of the 60 cycle input signal. At that time the internal power stored in the system would begin supplying power initially at the normal 60 cycle rate due to the resonance of the power supply circuits. Similarly, at this time, current would begin flowing out of the system due to this same energy storage due to internal impedance. This situation can be seen by examining FIGS. 2V and 2I at the instant designated as FAIL. The 60 cycle voltage and current signals will begin at a 60 cycle resonant frequency but will decay towards a lower frequency as time progresses. The signals shown to the right of the FAIL point is shown exaggerated for purposes of example. It is important to note that at the FAIL point, power begins to flow out of instead of into the system. As the invention shown in FIG. 1 is taking the product of volts and amps, it will instantly detect the moment when current reverses even though the voltage still exists on the voltage sense and current actually starts flowing the opposite way out of the system. 
     At the moment of failure, the voltage continues in the same direction, so Signal A, FIG. 2A, does not change its polarity and the signal will not reverse again until the voltage crosses the zero crossing line shown at FIG. 2V. However, the current instantaneously reverses as seen in FIG. 2B. Accordingly, multiplier 30 which has been seeing proportional input signals now instantaneously notes the 180 degree reversal of current from OP AMP 20 and instantaneously reverses the polarity of the signal as shown in FIG. 2C. FIG. 3C&#39; denotes the limited version of the signal after action by diode 32. At the particular FAIL point designated, for example, the fail time happens at a time that the one-shot 40 is generating a signal. Thus, the output of NAND gate 50 remains at a high, or logic 1, output for the time being. 
     As the power begins flowing out of the system, with a reversal of current polarity, the Signals A and B are shown accordingly in conjunction with its crossings of the zero axis in FIGS. 2V and 2I. The output signals of multiplier 30 are no longer proportional to the standard power factor delay but begins to generate signals of varying width in accordance with the zero crossings of the current and voltage seen in FIG. 2. However, one-shot 40 continues to generate signals of constant width due to its time constant determined by resistor 42 and capacitor 44. Thus, the first signal pulse to the right of the FAIL point in FIG. 3C&#39; is wider than the time of the output from one-shot 40, Signal D, and thus for the first time NAND gate 50 denotes at its inputs two logic 1&#39;s and thus the output of NAND gate 50 goes from the long term logic 1 to a logic 0. This can be seen in FIG. 3E of the designation of Signal E. When Signal E goes, for the first time to a logic 0, flip-flop 60 can be set or reset accordingly in order to energize subsequent circuitry to remove volatile data to a non-volatile storage medium and thus protecting the competency of the program and data being run on the unit. 
     Thus, after a failure point the circuitry instantaneously, within the one or two milli-seconds in which the data can be shifted to a non-volatile storage medium, the circuitry instantaneously detects the reversal of current and the instantaneous drop to zero of the voltage in the system. The one-shot which has been triggered every time in proportion to the phase shift between the input voltage and current signals, now is detecting the change in threshold voltage at the one-shot and thus the logic level at the output of NAND gate 50 becomes a logic 0 for the first instance and triggers subsequent circuitry for protection of the volatile data. Once the instantaneous output denoting a failure is generated and the data is transferred to registers and other permanent memories, the circuitry will still operate for some time but by then the data has been protected and no further monitoring of the circuit is necessary. Thus, within approximately 1 milli-second of power failure, the internally stored power in the system has energized protection circuitry which moves the data to a permanently designed storage for subsequent use at the time system power is reapplied. 
     Thus, while the invention has been described with reference to a specific embodiment, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted for elements thereof without departing from the true spirit and scope of the invention. In addition, many modifications may be made to adapt to a particular situation without departing from the essential teachings of the invention.