Abstract:
A method and apparatus for rapidly analyzing ac waveforms containing dc offset by generating digitized samples of the waveform to be analyzed with alternate samples separated by ninety electrical degrees. Alternate samples are paired for calculation of the magnitude and phase of the waveform. A suitable microcomputer performs a calculation using pairs of the most recently generated samples. Using the pairs of samples, the microcomputer calculates the dc offset, and the peak magnitude of the waveform which may be voltage or current. The phase angle of the waveform can also be calculated if required. The method and apparatus are particularly useful with protective systems where the calculation is necessary to determine whether there is a fault on an electric power transmission line. In addition, the effects of dc offset are eliminated and thereby false trips are avoided. A reliable system having a fast response time at relatively modest cost is provided.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of Invention 
     This invention relates to determining the magnitude and phase of an ac signal in less than one cycle even with dc offset present. More particularly, the invention discloses a method and apparatus for generating samples of sinusoidal current or voltage which are then used in a mathematical solution described in the invention to determine magnitude and phase. It is particularly useful in the presence of dc offset. Use of relatively few samples with a fast response time is disclosed. The invention is described in connection with protective relays. 
     2. Background Information 
     It is often necessary in electric power transmission systems to compute the magnitude and phase of the line current or voltage. Such computations are performed, for example, in protective relays. 
     In the case of protective distance relays, components are placed at each terminal of the protected line segment, these components analyze line currents and voltages to determine the location of a fault and trip circuit breakers at the respective terminals to isolate a fault determined to be between terminals. The invention can be used in such a relay system to measure the current and voltage. 
     The calculation of line voltage and line current as well as the phase is often made more difficult by the presence of dc offset. DC offset, such as could occur when a transformer is brought on line, can cause false trips in certain protective relays. 
     It is known that transient exponential noise can be reduced by substituting a compensated signal for the noise using linear approximations of the exponential component. Pending U.S. Patent Application Ser. No. 207,354 discloses a method and apparatus for reducing transient exponential noise in a sinusoidal signal by determining from digital samples of the signal the slope and initial ordinate value of a linear approximation of the transient exponential noise. The invention derives compensated values of current and voltage directly from digital samples of the waveform, and provides such compensated values from the beginning of the transient within one-half cycle of transient initiation plus one additional sample interval The compensation involves deriving the slope of the linear approximation of the exponential component of the transient by adding the magnitudes of each of a first pair of digital samples for instants spaced one-half cycle apart to produce a sum, subtracting from this sum the magnitude of each of a second pair of digital samples also one-half cycle apart and spaced from a corresponding one of the first pair of digital samples by a preselected number to produce a result. 
     The ordinate value of the linear approximation of the exponential component of the transient is determined by calculating the average of the magnitudes of the first pair of digital samples and adding to that average the sum of the magnitudes of the first pair minus the sum of the magnitude of the second pair divided by the number of intervals between corresponding samples in the first and second pairs of samples. 
     The method and apparatus discussed above does not involve calculation of magnitude and phase from alternate samples which are spaced by ninety electrical degrees of the waveform. In addition, there remains a need for a method and apparatus for accurate calculation of magnitude and phase in the presence of dc offset using relatively few samples and having a response time of less than one-half cycle. 
     As can be seen from the above, there is a need in many applications for a technique for rapidly analyzing waveforms, preferably in less than one power cycle. Further, the calculation must be made on-line with relatively modest hardware if it is to be cost competitive. 
     SUMMARY OF THE INVENTION 
     These and other needs are satisfied by the invention which is directed to a closed-form mathematical solution to the difficulty in measurement of magnitude and phase described above. The present invention provides for accurate determination of magnitude and phase even in the presence of dc offset. 
     The invention assumes sinusoidal currents and voltages. The invention is based on generating samples of the relevant electrical parameter, i.e., either current or voltage, with alternate samples separated by ninety electrical degrees of the line current or voltage, as the case may be. For computational purposes, those alternate samples are paired. For example, a first sample is generated which may be the first component of a first pair, the next sample is generated which would be the first component of a second pair, a third sample is generated at ninety electrical degrees of the line current or voltage from the first sample and that third sample would be the second component of the first pair. Another sample is then generated ninety electrical degrees apart from the second sample, and this completes the second pair, and so on. This generating sequence continues as long as the invention is in use. 
     Under certain conditions, which are described more fully hereinbelow, eight samples (four pairs) are required for performing the calculation of magnitude and phase Under other conditions, four samples (two pairs) are sufficient. In the latter case, the mathematical computation is continuously performed on the four most recent samples. In the former case, the computation would be continuously performed on the eight most recent samples. As a new sample is generated the oldest sample is discarded and the computation, which is described in detail below, is performed on the newest samples. 
     As mentioned above, the invention is directed to an ac electric power transmission system having sinusoidal currents and voltages which may also have decaying dc offset. The invention involves generating digitized samples of current or voltages at the predetermined intervals and performing certain calculations using pairs of the samples to determine the dc offset and the magnitude of the desired electrical parameter (i.e. current or voltage). In a preferred form the samples are generated at intervals of forty-five degrees of the waveform, and alternate samples are paired for the purpose of calculation of magnitude and phase. 
     If required in the application of the present invention, the magnitude as determined may be compared to a predetermined value and if it is equal to or in excess of that predetermined value, a signal is generated to trigger a desired event, such as tripping a circuit breaker. 
     In addition, the invention includes circuitry discussed in further detail herein which allows the calculation process to continue as new samples are generated. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     A full understanding of the invention can be gained from the following description of the preferred embodiments when read in conjunction with the accompanying drawings in which: 
     FIG. 1 is a waveform diagram indicating current, dc offset, and indicating a set of sample points for the electric power system with which one preferred embodiment of the invention may be used. 
     FIG. 2 is a diagram of a circuit incorporating the invention. 
     FIG. 3 is a flow chart of a suitable microcomputer program which can be used to implement the invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1 illustrates the sinusoidal waveform 1 of the current in a typical electric power transmission system with which a preferred embodiment of the invention may be used. The current is depicted by waveform 1 and the samples 2 are taken at predetermined intervals. FIG. 1 also depicts dc offset present in the current of the system, which can be induced, for instance by switching a reactive load onto the system. The dc offset Δ having decay constant α is decaying as depicted by line 4 The magnitude I of the peak value of the current of waveform 1 may be described in the following equation: 
     
         i.sub.k =I sin θ&#39;Δ.sub.k                       Eq. (1) 
    
     where i k  represents the instantaneous value of the sample; 
     I represents the peak value of the sinusoidal component; 
     θ represents the phase angle at the first sampled point; and 
     Δ k  represents the dc offset of the Kth sample. 
     As mentioned above pairs of samples are generated with the samples in each pair 90 electrical degrees of the current fundamental frequency apart. Successive samples are taken within ninety degrees of the preceding sample. In the preferred form, two interleaved pairs spaced 45 electrical degrees apart are used. The samples are taken continuously at 45 degree intervals with the four most recent samples retained so that a new calculation can be made every 45 degrees. As can be seen from FIG. 1, the minimum response time in the preferred form will be slightly more than 3/8 of a cycle. This would include the computational speed of the hardware which would depend upon the microprocessor used in the application. In the exemplary embodiment, a conventional 16-bit general purpose processor is contemplated which would require approximately 200 microseconds to perform the algorithm of the present invention. It should be understood that other processing units may be used which could be faster or slower in computing the algorithm. As noted above, successive samples must be taken within ninety degrees of the preceding sample. This means that the maximum response time is slightly less than 1/2 cycle. 
     The samples so generated are used in the above equation as follows: 
     
         i.sub.1 =I sin θ+Δ.sub.1 
    
     
         i.sub.2 =I (sin θ+.sup.π /4)+Δ.sub.2 
    
     
         i.sub.3 =I (sin θ+.sup.π /2)+Δ.sub.3, or i.sub.3 =I cos θ+Δ.sub.3 
    
     
         i.sub.4 =I (sin θ+.sup.3π /4)+Δ.sub.4, or i.sub.4 =I cos (θ+.sup.π /4)+Δ.sub.4                      Eq. (2) 
    
     squaring both sides and summing, and using the identity: 
     
         sin.sup.2 θ+cos.sup.2 θ=1 
    
     The following may be obtained: 
     
         (i.sub.1 -Δ.sub.1).sup.2 +(i.sub.3 -Δ.sub.3).sup.2 =I.sup.2 
    
     
         (i.sub.2 -Δ.sub.2).sup.2 +(i.sub.4 -Δ.sub.4).sup.2 =I.sup.2Eq. (3) 
    
     It is known that where samples are taken at equal intervals, the decaying dc offset Δ k  at any point in time may be described as follows: 
     
         Δ.sub.k =α.sup.(k-1) ×Δ            Eq. (4) 
    
     where α is the per-unit decay between samples .If samples are not taken at equal intervals, then K cannot be assumed to be equal to 1, 2, 3, 4 . . . etc. Instead K would have to be incremented differently and this would be known to one skilled in the art. Returning to equations (3), substituting as above for Δ k  and eliminating I 2  yields ##EQU1## It can be seen that this is a quadratic equation for Δ. It can be solved if the decay constant α is known. 
     Alternatively, in cases where there is a comparatively long dc offset, the decay in one-half cycle is negligible. In such a case, the assumption may be made that α is equal to 1. In that case, equation (5) becomes: ##EQU2## Δ is then calculated from equation (6). Now, the magnitude I can be calculated from equation (3) above. The phase angle θ can be calculated from equation (2) above. 
     If, on the other hand, α is not known and if it were determined that in the application the error in assuming α to be equal to one would be too great, then four additional samples would be required to yield two equations (5) with two unknowns which can be solved for α and then for Δ. Thereafter, magnitude I can be calculated from equation (3) and the phase angle θ can be calculated from equation (2). 
     The sampling algorithm set forth above allows 
     determination of magnitude and phase with as few as four samples of current or voltage to be taken in less than 1/2 cycle of the powerline. 
     Application of the invention to a protective relay in an ac electric power transmission system is depicted in the circuit diagram of FIG. 2 While a single phase circuit is shown in FIG. 2, it should be understood that the invention would actually be used in conjunction with a three phase system and an identical circuit as shown in FIG. 2 would be present for each phase of the system. The microcomputer (discussed below) would perform the relevant calculations for each phase 
     Referring now to FIG. 2, in one embodiment of the invention, transmission line 5 has first phase current i having a sinusoidal waveform Current transformer 6 generates a current proportional to the current in the line 5. 
     Samples of current for use in the calculation of magnitude and phase are generated as follows: the ac current i is converted into a dc current by full wave rectifier 8. Resistor 9 converts the rectified output current from rectifier 8 to a voltage signal which is proportional to the magnitude of the current in the line. Unipolar analog-to-digital converter 10 accepts the positive voltage and generates at output 14 digitized samples representative of the amplitude of the current. Microcomputer 12 receives the digitized samples as inputs and is suitably programmed, as discussed hereinbelow, to perform the calculations required to produce the magnitude and phase of the current. Microcomputer 12 controls the sampling rate at which analog-to-digital converter 10 generates samples of the current for use in the calculations by a pulse sent to input 15 of analog-to-digital converter 10. 
     Microcomputer 12 must also receive information regarding the sign of the current. In the exemplary embodiment of the invention, the voltage V D  across the ac inputs to the full wave bridge rectifier 8, is applied to a comparator 16 which compares V D  to ground to generate a logic signal representative of the sign of i. It can be seen that when i is positive, the logic signal is equal to +5 V applied through resister 19. When i is negative, the logic signal is pulled to ground. This logic signal provides information about the sign of the current to input 13 of microcomputer 12. 
     Alternatively, an analog-to-digital converter in a bipolar mode (not shown) could be used. This would avoid the necessity of full wave rectifier 8. Both sign and amplitude would be generated from such an analog-to-digital converter. 
     Using the information about amplitude and sign, microcomputer 12 performs the calculations described above to generate present values for magnitude, phase and dc offset. In the preferred embodiment, the invention may be used in a protective relay system. Microcomputer 12 could be suitably programmed as discussed below to further perform a comparison of the magnitude of current to a predetermined value. If the magnitude of current exceeds this predetermined value, microcomputer 12 would generate a high output signal which would effect a response in the system. For example, the invention may be used in conjunction with an overcurrent relay in which the value of the magnitude of the current is compared to a set point and if it exceeds that set point, the output signal is high. This would ultimately effect an interruption of the system, by tripping a circuit breaker, for example 
     In the exemplary embodiment, the output 18 of microcomputer 12 is applied to the gate of a FET 20. FET 20 is turned on when the output of the microcomputer 12 goes high. When FET 20 is turned on, coil 22 is energized and normally open contact 26 is closed Trip coil 24, in turn, becomes energized. This trips breaker 25 and the system is thereby protected. 
     In other applications, it is desired to measure the voltage in the system in addition to or in place of the current. As shown in FIG. 2 the circuit may also include appropriate components adapted to generate samples of voltage and perform calculations on voltage samples. In such a case potential transformer 23 is placed on line 5. The amplitude of the voltage of one phase would be generated by applying the output of potential transformer 23 to a suitable voltage input circuit 35. Voltage input circuit 35 would include elements similar to those contained in the circuit in relation to current transformer 6. For example, the voltage output would be full-wave-rectified and a suitable resistance would be placed across the output of the resistance (not shown). This would be applied to a unipolar analog-to-digital converter which would thereby generate the magnitude information which would be provided to input 37 of microcomputer 12. Sign information would be generated by a combination similar to comparator 16 and resistor 19 as discussed above and this signal would provide sign information to input 36 of microcomputer 12. 
     Preferably samples would be generated at intervals of forty-five degrees of the line voltage Microcomputer 12 would perform the calculations of magnitude and phase. In addition, microcomputer 12 could be adapted to further perform a comparison function or a monitoring function as required in the relevant application 
     Referring now to FIG. 3, the flow chart of a suitable program for microcomputer 12 of FIG. 2 is shown. Timer interrupt subroutine 27 regulates the intervals at which the calculations are performed. The samples, i k , are generated as inputs to the microcomputer 28. Each sample is stored, 29, as it is generated. Depending upon the circumstances of the relevant application of the invention the four or eight most recently stored samples are always retained. As a new sample is stored, the least recent sample is discarded. At 30, the dc offset Δ is calculated using the four most recent samples, i 1 , i 2 , i 3  and i 4 , in equation (6). In one embodiment of the invention, the magnitude of current I is then calculated, at 31, using equations (3). In another application, four more samples would be required to solve two equations (5) with two unknowns. Then the magnitude of the current I could be calculated using equation (3) as discussed in detail above. 
     A comparison may be made between I and a predetermined value, I trip , 32. If the value is greater than I trip , then a suitable trip subroutine 33, which would be known to one skilled in the art, is called. 
     It should be understood that the invention may also be used to monitor currents and voltages and does not necessarily require the comparison of magnitude to a predetermined value. 
     While specific embodiments of the invention have been described in detail, it will be appreciated by those skilled in the art that various modifications and alternatives to those details could be developed in light of the overall teachings of the disclosure. Accordingly, the particular arrangements disclosed are meant to be illustrative only and not limiting as to the scope of the invention which is to be given the full breadth of the appended claims and any and all equivalents thereof.