A method for the digital electronic measurement of periodic electrical quantities, and an instrument for the implementation of such a method

Abstract: The method is one of using an instrument with one or more operational amplifiers (2) to sense the value first of a voltage and then of the relative current, inducing a known delay (Δt) and applying a reference voltage (V r ) at the amplifier input to render all the signals positive, then converting these initial analog values to digital voltage and current values (V 1i , I 1i ) corrected by subtracting the offset value of the operational amplifier (2), which is obtained by averaging the digital values; the instrument (1) also comprises an analog-digital converter (7) as one component of a data processing unit (4), which further incorporates a switch (5), a sample-and-hold circuit (6), a memory (8) having an internal shift register (9), and a control unit (10) programmable by means of software and capable of shifting the compensated current value (I 1i ) into quadrature (I 90i ) in such a way as to allow a direct calculation of reactive power by way of the shift register (9).

Description: The present invention relates to a method for the digital electronic measurement of periodically varying electrical quantities, and to an instrument for its implementation. EP-A-0 462 045, from which the preamble of claim 1 has been derived, discloses a method and apparatus for the digital electronic measurement of periodic electrical quantities in an electronic circuit. In particular, in claim 1 of this document there is disclosed an apparatus for monitoring an electrical power supply having first and second electrical parameters exhibiting given relative cycle phase relationship comprising; scaling means connectable with said supply for deriving first and second electrical parameter signals for corresponding cycles of said supply having a post scaling relative cycle phase relationship; a cycle phase shift network responsive to a select said electrical parameter signal and controllable for aligning said post scaling relative cycle phase relationship to a correspondence with said given relative cycle phase relationship to provide first and second cycle phase corrected electrical parameter signals; a sampling network actuable for sampling the amplitudes of said first and second phase corrected electrical parameter signals and deriving corresponding first and second digital sample signals; and control means for controlling said cycle phase shift network, for actuating said selector means within predetermined regular sampling intervals to derive said first and second digital sample signals for effecting select arithmetic treatment of said first and second digital sample signals to derive digital power quantity signals, and for selective accumulating said digital power quantity signals to derive pulse categorized meter output signals. In an electronic circuit connected to an a.c. power supply, many electrical quantities of a periodic nature, i.e. variable over time, can be measured by applying known electrotechnical principles. Such quantities can be grouped into two distinct categories, identifiable according to the manner in which measurement is possible. Quantities belonging to a first category, or primary quantities, namely voltage and current, can be measured directly by means of suitable instruments. Those belonging to a second category, or secondary quantities, including types of power, and power factor, are quantities of which the values are deduced by way of mathematical processing operations performed on measured voltage and current values. It is therefore clear that both voltage and current must be measured in any event. Conventionally, there are two principal methods of measuring primary periodic electrical quantities, i.e. voltage and current. In the first such method, which can be utilized with reasonable confidence only under laboratory conditions, the peak or crest value, that is to say the maximum value assumed by the monitored quantity within the measured period, is converted into an equivalent direct voltage and this same equivalent direct voltage then measured. The second method, which is a sampling procedure, consists rather in effecting a selected number of measurements, or samples, of the monitored quantity and assuming the effective (r.m.s.) value as the measured value. The theoretical formula allowing calculation of the effective value of a periodic quantity having period T states that the value of the periodic quantity equals the square root of the integral from zero to period T of the squared value of the quantity, multiplied by dt . The practical formula, used in place of the theoretical for the purposes of calculation, states that the value of the periodic quantity equals the square root of the squares of single values of the quantity from 1 to n summated and divided by n , where n is the number of samples. The first method is especially simple and can be implemented with similarly simple instruments, but is of limited practical use, being dependable only as long as the quantity to be measured is perfectly sinusoidal, hence, as aforementioned, in laboratory conditions where all potential sources of error can be monitored and eliminated. It happens in the majority of instances, however, that the waveform of the measured quantities will be distorted due to the presence of harmonics, and any value that can be measured will be equal to the sum of different waveforms registering at a given moment; accordingly, only the second method, based on sampling, can ensure valid results. Concentrating exclusively on the sampling method, the value obtainable becomes that much more precise and dependable as the sampling frequency increases, as the summation tends to produce results more and more comparable with those of the integral in the theoretical mathematical formula. The method in question is implemented typically by means of a circuit which comprises, in sequence, a differential amplifier, a sample-and-hold device, an analog-digital converter and a microprocessor. The signal reflecting the quantity to be measured is received by the amplifier and relayed, suitably amplified and with any disturbances filtered out, on to the sample-and-hold device, the function of which is to store the signals in analog form for a prescribed duration before supplying them to the input of the ADC. This converts each signal into a number and relays the number to the microprocessor, which memorizes all the values received and effects the necessary calculations. In addition, the power supply to the measuring circuit needs to be both positive and negative, as the quantity measured is generally periodic and will therefore vary between positive and negative values. The selfsame circuit, suitably modified by the addition of various components, can be utilized to measure the active power of the monitored circuit. Such a measurement is effected by taking voltage and current samples simultaneously and multiplying together the resulting values. The formula used in the subsequent calculation states that active power is equal to the sum of the products, from 1 to n , obtained by multiplication of the voltage value with the corresponding current value, divided by n , where n is the number of samples. This practical formula is similarly valid for the calculation of reactive power, provided that current and voltage values are sampled 90° apart. The measuring circuit thus requires two operational amplifiers and two relative sample-and-hold circuits connected to the inputs of a multiplexer, of which the output stage is connected to an input of the ADC, the output of the ADC being connected in turn to an input of the microprocessor. The multiplexer first receives one signal, voltage for example, which is duly relayed to the ADC, and thereafter a second signal, current in this instance, likewise passed on to the ADC. The microprocessor therefore receives two numbers in succession, which it multiplies together. As the analog-digital conversion takes a certain amount of time, the two sample-and-hold circuits will retain the signal received from the relative amplifier for a duration at least equivalent to the period of time required by the ADC to perform the operation. The dynamic characteristic of the measuring circuit is optimized by adding a variable gain amplifier between each of the operational amplifiers and the relative sample-and-hold circuit, controlled by the microprocessor and functioning as a scale changer. Evidently, a measuring circuit of this nature is rendered somewhat costly by reason of the numerous components it comprises, and of the characteristics each such component must possess in order to ensure that its task is performed correctly: for example, the need for the various components to be connected to a power source with both positive and negative polarity in order to respond correctly to a signal which varies between positive and negative values. Also, the operation of the scale-changing variable gain amplifiers is such as to alter the operating constants of the circuit overall, since in practice the single amplifier will be composed of a number of circuits coupled in parallel, furnished with a resistor and a relative static switch. Each static switch functions as a variable resistor responding to temperature, and the gain of the amplifier is modified not only varying the number of circuits connected in parallel, through which current flows simultaneously, but more especially by shutting off one circuit rather than another. This means that a variation in resistance occasions an accompanying change in compensation, as the reference or offset values are also altered. What is more, the variable gain amplifiers need to be of superior quality, a feature dictating high cost, precisely in order to ensure effectiveness within a wide operating range compassing each of the single ranges relative to the individual scales in which measurements are to be possible. It will be clear from the foregoing that electronic instruments currently available for the measurement of electrical quantities are typified by high cost, and that the cost rises disproportionately with any increase in performance and in the required level of precision, by reason of the need to add further elements or devices which in turn dictate the need for further corrections. In a three-phase circuit, for example, reactive power is measured by sensing voltage linked across two phases and current on the remaining phase. In single-phase circuits, on the other hand, use is made of analog devices which in order to give an acceptable level of precision must necessarily involve an appreciable cost. In addition, again considering the calculation of reactive power and utilizing the digital sampling method with processing by the formula which states that the value of reactive power is equal to the square root of the product given by multiplication of the voltage and the current, sampled in phase and squared, subtracting the squared value of the active power also sampled in phase, one quadrant only of the waveform can be covered, so that the mathematical sign of the reactive power remains unobtainable and it cannot be established whether the monitored circuit is capacitive or inductive. The object of the present invention is to provide a method for the measurement of periodic electrical quantities, and an electronic instrument for its implementation, which will afford notable economies of construction while losing nothing in accuracy. The invention will now be described in detail, by way of example, with the aid of the accompanying drawings, in which: fig 1 is the electrical diagram of an instrument for measuring electrical quantities according to the invention, shown in a simple embodiment; fig 2 is an electrical diagram indicating a more complete embodiment of the measuring instrument as in fig 1; fig 3 shows the graph of an electrical quantity modified by the instruments of figs 1 and 2; fig 4 is a graph showing the waveform of current or voltage generated at 50 Hz, obtainable with an instrument as in fig 1 or 2; figs 5 and 6 are graphs showing the waveforms of current or voltage generated at 50 Hz and 60 Hz, respectively, obtainable with an instrument as in fig 1 or 2 over a complete measuring period; fig 7 is a graph drawn on larger scale and showing how voltage and current values are sampled using an instrument as in fig 1 or 2; fig 8 shows two graphs illustrating the effective values respectively of voltage and current in phase and of voltage and current 90° apart, suitable for use in calculating active power and reactive power, obtainable with an instrument as in fig 1 or 2; fig 9 is a flowchart illustrating the operation of an instrument as in fig 1 or fig 2. The method to which the present invention relates is based on the conventional technique of sampling, and allows the digital electronic measurement of periodic electrical quantities in an electronic circuit employing an instrument of notably simple circuitry; in the method disclosed, the values of electric current and voltage, or viceversa, are sensed by introducing a predetermined and preset delay or phase shift Δt as indicated in fig 7, in which V i and I i denote the values of input voltage and input current, respectively, or in any event the values registering at the terminals 3 of the monitored circuit. Likewise according to the method of the invention, the phase shift of 90° between current and voltage, induced to allow the calculation of reactive power, is effected following the step in which the analog values are converted to digital, and obtained by storing the values in a dedicated memory circuit for a period of time equal to that required by the waveform of the shifted periodic quantity to cover the 90°. More exactly, each digital current value is memorized in a storage device having a number of locations equivalent to the number of samples it is intended to effect for each quarter of the current waveform, as will become clear in due course. Finally, where an operational amplifier is employed in sampling voltage and current values, the method also includes the step of generating an arbitrary reference internally of the amplifier, of which the effect is to render all input values positive and thus allow the use of an analog-digital converter designed to handle positive analog values only. By virtue of this expedient, the operational amplifier can be driven utilizing a power source of positive polarity only. For a fuller appreciation of the potential afforded by the method disclosed, a preferred instrument for its implementation will now be described in detail with reference to the accompanying drawings. The measuring instrument according to the present invention, denoted 1 in its entirety, essentially comprises an operational amplifier 2 and a data processing unit 4. Fig 1 shows the instrument 1 in a simple embodiment, whereas fig 2 illustrates a more complete version of the arrangement in fig 1. Reference is made throughout the specification to the second of these two embodiments, purely by way of example. The data processing unit 4 comprises a plurality of mutually integrated components shown schematically as discrete blocks in figs 1 and 2 so as to give a clear indication of the various operations the unit will be able to perform. The components in question comprise a switch 5, a sample-and-hold circuit 6, an analog-digital converter or ADC 7, a memory 8, a shift register 9, a software-programmable control unit 10, also a data transmission device 11 and a timer 13. The switch 5 is an electronic device able to direct signals from different sources to a single user. In the particular example of fig 2, the inputs of the switch 5 are connected to the outputs of a number of operational amplifiers 2, or of one multiple operational amplifier consisting structurally or functionally in a plurality of single operational amplifiers. In this instance the switch 5 will be operated by the control unit 10 and is capable of supplying an output consisting in the signal from just one of the operational amplifiers 2. The shift register 9 constitutes a part of the memory 8, and is operated by the control unit 10 as a separate device by which a predetermined number of digital values can be memorized, one after another, then discarded from their allocated memory locations and restored in sequence from first to last: in short, the shift register 9 operates on the principle of first-in-first-out, or FIFO. The data transmission device 11 permits of connecting the data processing unit 4 to a further device, for example a computer which might perform further processing operations on the received data, in this case the exact values of the various measurements. The data transmission device 11 might be capable of transmitting data bidirectionally, so as to allow of programming the control unit 10 from an external computer utilizing suitable software. Normally, at all events, the data transmission device 11 will be connected to the memory 8, as illustrated in figs 1 and 2, from which it receives the stored values in the mode and with the timing established by whatever unit may be connected to the data transmission device 11. The operational amplifiers 2 are associated with a circuit 12 of which the function is to generate a constant and well defined voltage V r applied to the input stage of each one and serving as a reference value. The operational amplifiers 2 shown in fig 2 are all different one from another, inasmuch as the gain of each amplifier is set to ensure its precise operation within a respective and exactly defined range or scale of values. Fig 2 illustrates five such operational amplifiers 2 of which the first two uppermost in the diagram are used to sense the value of the voltage at the terminals 3, or input voltage V i , whilst the three remaining amplifiers below serve to sense the value of current at the terminals 3, or input current I i . The outputs of all five operational amplifiers 2 are connected to respective inputs of the switch 5, which in turn will supply the sample-and-hold circuit 6 with one only of the signals received from the operational amplifiers 2, as determined by a command from the control unit 10. The function of the sample-and-hold circuit 6 is to store the signal received from the switch 5 for the period of time required by the ADC 7 to convert the received signal to a number, which is transmitted to the control unit 10. The timer 13 clocks the interval and informs the control unit 10 of the exact instant in which the instrument 1 is to respond; in short, the timer 13 gives the sampling frequency, in that it indicates the number of acquisitions of voltage and current values made per unit of time during the measuring operation. Observing the instrument of fig 2 and the flowchart of fig 9, the operation of the instrument 1 will now be described, to the end of allowing a fuller appreciation both of the instrument itself and of the method disclosed. Each block of the flowchart is denoted by a single capital letter, with the exception of the first and the last, and it is to these letters that reference is made. As soon as power is supplied to the instrument 1, the timer 13 begins clocking, and provides the control unit 10 with pulses or signals indicating the start of a sensing or sampling cycle. To allow the measurement of periodic electrical quantities in the alternating currents most widely utilized, the instrument effects a number n of samples per unit of time such as will produce a whole number of waveforms for the measured periodic quantity within the clocked period. With regard in particular to those electrical quantities having 50 Hz and 60 Hz frequency respectively, to which reference is made in the specification strictly by way of example, values are sampled over an interval of 100 ms in such a way that a whole number of waveforms can be obtained both from a 50 Hz and from a 60 Hz source. Thus, five whole waveforms will be obtained from current and voltage at 50 Hz (see fig 5) and six whole waveforms from current and voltage at 60 Hz (see fig 6). The measuring period is set at 100 ms, as this is a multiple of the period of one waveform (the period being the time taken by the electrical quantity under scrutiny to return to a given value) whether generated at a frequency of 50 or of 60 Hz. In addition, the number n of samples selected will be a number divisible both by 4 and by the whole number of waveforms occurring in the chosen period, namely 100 ms in the case in point. For 50 Hz and 60 Hz frequencies, the number might be n =240, thus giving 48 samples per waveform in the case of 50 Hz and 40 samples in the case of 60 Hz. The number 240 is also divisible by 4, for a reason that will be made clear in due course. The first step executed by the control unit 10 is that of configuring the switch 5 to establish which two of the operational amplifiers 2, one for voltage and one for current, will supply source values to the data processing unit 4. This selection of operational amplifiers 2 is made on the basis of the values of voltage and current sensed during the previous measurement and stored in the memory 8, or through the intention of a lower gain amplifier 2. The enabling of one operational amplifier 2 rather than another is a step executed automatically by the control unit 10 after each sampling operation, on the basis of the monitored values and of the calculations performed. If the control unit 10 finds that the value of the output from the enabled operational amplifier 2 is less than 25% approximately of its full scale, the switch 5 will be made to connect to a higher gain amplifier 2; conversely, if the measured value is more than 10% approximately of the full scale, the switch 5 will be piloted to select an operational amplifier 2 of-lower gain: in neither instance will any manual intervention be involved. At the same time, the circuit denoted 12 generates a reference voltage V r at the input of all the operational amplifiers 2, as illustrated in fig 1 and fig 2. The value of V r will be equivalent to approximately half the reference voltage of the ADC 7, and in addition, the input signal is adjusted in such a way as to regulate the amplitude at a peak-to-peak value equivalent to some 20% less than the dynamic range of the analog-digital conversion circuit. In other words, on the basis of calculations effected by the control unit 10 in the course of a typical measuring operation, the system responds during the successive operation in such a way as to ensure that the peak-to-peak value measured will remain between 25% and 80% of the maximum value that can be measured by the ADC 7, as discernible in fig 3. In this way, the signals transmitted to the input of the ADC 7 will be entirely positive, as shown in fig 3, and the waveform "displaced" upwards by the reference voltage V r . At power-up, the instrument 1 will assume default reference values; in the case of the reference voltage applied to each of the operational amplifiers 2, for example, this will be equal to the voltage V r generated at the input of the amplifier 2. A further operation effected by the control unit 10 before commencing the first measurement is that of determining the capacity of the shift register 9, i.e. defining the number of memory locations to be compassed by the shift register 9 in such a way as to contain one quarter of the samples that can be taken during one complete waveform of the current, or in effect to allow of storing the values sampled over one quarter period. In the case of the example mentioned previously, that is, 240 samples over a period of 100 ms duration, the samples per period of current or voltage will be 40 or 48 in number, according to the frequency. The number of usable locations afforded by the shift register 9 must therefore be 10 or 12, respectively. At the moment in which a pulse is generated by the timer 13 to signal the start of the sampling cycle, the control unit 10 enables the switch 5 to connect one of the voltage-sampling operational amplifiers 2 with the sample-and-hold circuit 6 (block A). The ADC 7 proceeds to convert the analog voltage V i received by way of the operational amplifier 2 and the sample-and-hold circuit 6, and having completed the conversion, relays the result to the control unit 10; the digital, or numerical voltage value V d is then entered in a first location of the memory 8 by the control unit 10, which pilots the switch 5 to connect the enabled current-sampling operational amplifier 2 with the sample-and-hold circuit 6. The ADC 7 now converts the sampled current signal I i to a corresponding digital value I d , and having made the conversion, transmits the result to the control unit 10, which stores the digital current value I d in a second location of the memory 8 and then waits for a new pulse from the timer 13 marking the start of a new sampling cycle. In practice, the end of one sampling cycle and the start of another can be almost simultaneous, the effect being to maximize the number of samples. It will be observed that the conversion of the current value begins after that of the voltage value, following a delay or phase shift Δt which is both known and determinable (see fig 7). The phase shift Δt in question is a known dimensional quantity, consisting in the sum of two consecutive periods of time denoted Δt 1 and Δt 2 , where Δt 1 is the measured and constantly repeated interval of time required by the ADC 7 to convert the voltage sample, and Δt 2 is the time, likewise measured and constant, taken by the control unit 10 to perform a predetermined and constantly repeated number of operations, which involve entering the digital voltage value V d in the respective location of the memory 8 and piloting the switch 5. Whilst the effect of the phase shift Δt is in practice to introduce an error, the error is a known quantity and therefore easily compensated and corrected. Following the acquisition or memorization of the digital voltage and current values V d and I d , these values are taken and processed singly: block B of the flowchart denotes the operation of multiplying by 256 to give 16-bit values, the significance of which is well known to a person skilled in the art, followed by summation with those stored previously to allow calculation of the updated reference value for the operational amplifier 2. In operation, each digital sample value, whether voltage V d or current I d , is multiplied by 256 and converted into a 16-bit number. This number is then added to the sum of the previous samples processed in the same way, and the resulting value stored in a respective location of the memory 8 which holds the updated result of the summation; the mean value of the 16-bit numbers held in the various locations is then used as the reference or offset value. The reason for using a mean value as the reference or offset value derives from the fact that a periodic quantity such as voltage and current, unlessmodified as shown in fig 3, has a mean value of zero; accordingly, the reference or offset value for the operational amplifier 2 is obtained by measuring the mean value of the digital values sampled. This mean value is also equal to the sum of the programmed reference value V r plus the offset value as specified for the operational amplifier 2 (the intrinsic offset). This means that, even if the operational amplifier 2 utilized is of modest quality with a relatively high specified offset value, the measurement obtained will nonetheless be notably precise since the offset value is measured and discounted continually. Accordingly, after each digital value V d and I d has been multiplied by 256, the offset value of the operational amplifier 2 is subtracted. Thus, one obtains a 16-bit number with the relative sign. The two bytes of each digital voltage and current value are shifted in such a way as to obtain an 8-bit number with the relative sign and thereby ensure greater precision, the resulting digital voltage and current values V d and I d being compensated. Further attention may be given to this aspect of the method before proceeding, in order to illustrate how with simple mathematical operations performed by the data processing unit 4 it becomes possible to obtain precise measurements, even with operational amplifiers 2 of unremarkable quality. Each sample, an 8-bit number, is multiplied by 256 and converted into a 16-bit number. This number is then added to the other 16-bit numbers memorized previously, whereupon the 16-bit offset value, measured and calculated during the previous cycle, is subtracted from the number obtained by multiplication of the digital voltage value (V d x 256). The number obtained, still a 16-bit number, contains a sign and 6 or 7 bits in the most significant byte (8 bits). The fact that the number has a sign, positive or negative, can be discerned by observing fig 3 and considering the horizontal straight line passing through the value denoted V r as representing the 'x' axis. As concerning errors, the following observation may be made: where use is made of an analog-digital converter for the purpose of effecting measurements, it has to be remembered that such a device occasions an element of error generally proportional to its own number of bits. For example, an 8-bit converter has a typical error of plus or minus one bit, equivalent thus to 0,5% of the full scale. If the quantity to be measured is a quantity varying cyclically over time, as in the case of the disclosure, it can be demonstrated that, applying the effective value formula in the sampling method described above, the ultimate error in the measurement is reduced by a factor equal to the square root of the number of samples effected. This being the case, the subtraction of an 8-bit number gives place to a systematic error that is not compensated in the procedure described above. Accordingly, the step of subtracting the reference or offset value of the operational amplifier 2 is made a 16-bit operation in such a way as to reduce the systematic error introduced, by 1/256. The end result is converted back to 8 bits plus sign and rounded up to 1/2 bit, in such a way as allows the successive operations using 8-bit mathematics to be performed at high speed and without introducing any systematic error. The digital value is memorized and utilized in the form of an 8-bit number in order to reduce both the amount of memory needed and the time necessary for calculation, since the use of a 16-bit number would require a more powerful data processing unit 4 and increase the calculation time not twofold, but in fact fourfold over that needed for an 8-bit number. The use of a 16-bit offset value also permits of eliminating one product in calculating each sample. If the resulting corrected digital value is I 1i , relative to the current, this is memorized in the shift register 9, and more precisely in the first free location of the shift register 9, and will be processed no further. Both digital values V 1i and I 1i are squared, then added to the corresponding results of previous sums, the results being read in respective storage locations of the memory 8, and the updated sums then saved in the same locations. The digital voltage and current values V 1i and I 1i are multiplied together and the result is added to the result of the sum of the corresponding previous products. The final result of the sum is saved in a respective location of the memory 8. This product and the relative sum are used in the calculation of active power P 1 as will be described in due course. The digital voltage value V 1i is multiplied by the value I 90i memorized first in sequence in the shift register 9, and the resulting product is added to the sum of the corresponding products, whereupon the final result of the addition is memorized in a respective location of the memory 8. Given that the value saved first in the shift register 9 refers to ten or twelve operations beforehand (the example, it will be remembered, allows for 50 Hz and 60 Hz frequencies alike), the digital voltage value V d is multiplied by the digital current value I 90i phase shifted 90° from the voltage value V d in question. The resulting product and the sum of such products are then used in the calculation of reactive power. Naturally, the digital current value I 90i supplied by the shift register 9 is then discarded to allow the memorization of a new digital current value, posterior to those remaining. In simplistic terms, considering the various values as if lined up one behind the other, each operation consists in the last value being extracted and the remainder moved back one place so as to vacate the first position, this being the position in which the most recent value sampled and calculated is always memorized. The calculations relative to each sample are thus complete, and the procedure, both of measuring the voltage and current values and of performing the relative calculations, will be repeated n times (block C, fig 9). In the particular case in point, the calculations continue to be repeated until such time as 240 samples have been counted, whatever the frequency of the voltage and current (50 or 60 Hz). Once all the n samples are available, the control unit 10 will proceed to execute those calculations required to obtain the values of the primary and secondary electrical quantities relative to the electronic circuit from which the signals are taken at the terminals 3. These operations (block D) are performed with the aid of software by the control unit 10, which processes the various values stored in determined locations of the memory 8 and applies additional correction values stored similarly in other locations of the memory 8. The execution of these calculations is especially fast, depending purely on the speed of the data processing unit 4, and is entrusted to a single element characterized by low cost though lacking nothing in precision; in effect, the data processing unit 4 will consist in just such an element. First to be calculated are the measured voltage and current values, using the same formula, that is to say, in which the measured voltage value V 1RMS and the measured current value I 1RMS are each equal to the square root of the sum of the squares of the respective digital values V 1i and I 1i , divided by the number of samples, say 240. In the case of active power P 1 , this equals the sum of the products obtained by multiplication of the single digital voltage values V 1i and the relative digital current values I 1i , divided by the number of samples. Apparent power S 1 , on the other hand, is equal to the product obtained when multiplying together the measured voltage V 1RMS and measured current I 1RMS , whilst reactive power Q 1 equals the square root of the difference between the squares of apparent power S 1 and active power P 1 . Measured reactive power Q 1m equals the sum of the products given by multiplying the single digital voltage values V 1i and phase-shifted current values I 90i , divided by the number of samples. The last of the electrical quantities measured is power factor PF, which equals the ratio between active power P 1 and apparent power S 1 . At this point, again utilizing software, the control unit 10 proceeds to correct, or rather compensate the active power and measured reactive power values P 1 and Q 1m on the basis of the phase shift Δt introduced when measuring the voltage and current values V 1i and I 1i (blocks E and F). Before the compensation is applied, a check is run to verify the sign of the measured reactive power Q 1m . It will be observed that the ability of the instrument 1 disclosed to verify the sign of the measured reactive power Q 1m is attributable to the fact that the digital values of voltage V 1i and phase-shifted current I 90i incorporate the relative sign and are calculated throughout the entire cycle of the current and voltage, not merely during one quadrant of the waveform, i.e. 90° only, as occurs in the case of instruments embraced typically by the prior art. Accordingly, it becomes possible to verify the sign of the measured reactive power Q 1m and consequently to establish whether the monitored circuit is capacitive or inductive. With the sign of the measured reactive power Q 1m thus known, the control unit 10 will consult a compensation table, stored in the memory 8, which is compiled by means of mathematical calculations deriving from known laws of electrical engineering. Reading the table, the control unit 10 identifies the phase shift Δt introduced for measurement purposes, selects the corresponding compensation factor and applies it in multiplication both to the active power value P 1 and to the measured reactive power value Q 1m , in such a way as to obtain the exact values of these secondary periodic electrical quantities. All the values thus calculated, and if necessary compensated, are saved in determined locations of the memory 8, from where they can be retrieved by the data transmission device 11 as frequently as may be required without affecting the operation of the instrument 1 in any way. The data transmission device 11 might be connected to a display on which the various values are read out, or to a computer, which will store the data, or indeed to any given medium. At all events, the instrument 1 continues to operate in the manner prescribed irrespective of the particular use to which the data transmission device 11 may put the definitive values stored in the memory 8. Considering the method according to the invention again at this point, in the light of the foregoing description of the relative instrument 1 and its operation, the advantages will be clearly evident, namely: a reduction in the cost of instruments for the electronic measurement of periodic electrical quantities, and greater precision and repeatability of the measurements effected. The fact of applying an arbitrary reference to the operational amplifier 2 allows the use of an ADC 7 integrated into the data processing unit 4, since the device processes positive values only. This is in no way a limitation however, since the software used in conjunction with the control unit 10 is able, and with absolute precision, to compensate the converted digital voltage or current value V d or I d generated by the ADC 7 on the basis both of the arbitrary reference applied to the operational amplifier 2 and of the offset value calculated for the amplifier. The introduction of a known and predetermined phase shift between the voltage and the current allows the use of one operational amplifier 2 only and of one sample-and-hold circuit 6 only, also of just one analog-digital converter 7, integrated with and incorporated into the data processing unit 4, for the purpose of monitoring both voltage and current. Likewise in this instance, the software allows full knowledge and correction of the error introduced. Finally, the adoption of a data processing unit 4 piloted by appropriate software allows the use of a plurality of operational amplifiers 2 connected to the switch 5 of the data processing unit 4, thereby gaining not only the economic benefit of replacing a single high-cost amplifier with several standard operational amplifiers, but also greater precision inasmuch as any offset built into the amplifiers is measured individually and suitably compensated. Observing figs 5 and 6 in particular, it will be seen how a greater number of samples can reproduce current and voltage waveforms with a high degree of precision. The two graphs of fig 8 show voltage and current waveforms superimposed, the top graph with the current in phase, and the bottom graph with the current in quadrature as a result of inducing the phase shift Δt, to allow the calculation of active and reactive power. As regards conversion errors, these are reduced in the method disclosed by a factor proportional to the square root of the number of samples. The values of the periodic electrical quantities measured can be retrieved from the memory 8 via the data transmission device 11 using a computer which, suitably programmed by software, will be able to perform an exact calculation of the power absorbed by the monitored circuit as long as the instrument is on standby or activated. An instrument 1 as described above, equipped with an additional switch 5, can be used to measure the single phases of a three-phase system, in sequence, sampling for 100 ms on each phase. If the sine and the cosine of the phase angle between voltage and current are known, also the type of connection, it will also be possible to reconstruct any parameter using conventional laws of electrical engineering.

Claims: A method for the digital electronic measurement of periodic electrical quantities in an electronic circuit, namely the primary quantities voltage and current and secondary quantities such as active and reactive power and power factor, which utilizes sampling and comprises the steps, executed for each successive sample, of sensing the values of voltage at a terminal (3) of the electronic circuit and of sensing the values of current at a further terminal (3) of the electronic circuit, converting the sensed analog voltage and current values into digital values, memorizing the digital values, processing the digital values and saving the results of such processing, wherein the current value (Ii) and the voltage value (Vi) are sensed one after the other at the terminals (3) indroducing a predetermined and preset phase shift (Δt) between the voltage and current values ; and either the voltage or the current value is shifted 90° in relation to the other following the analog-digital conversion, to the end of allowing calculation of the reactive power of the circuit, by memorizing the digital value for a period of time corresponding to one quarter of the period of the waveform exhibited by the sensed periodic quantity reflecting voltage or current, characterized in the step of sensing voltage and current values (Vi, Ii) being effected by means of an operational amplifier (2) to which a reference voltage (Vr) having a predetermined value is applied such that all values monitored by the amplifier are positive, comprising the further step of calculating the mean values of the digital voltage values and digital current values for use in the successive measuring step as offset values for the operational amplifier (2) which are subtracted from each corresponding digital voltage value and current value in calculating compensated digital voltage and current values for each sample, said respective mean values representing the sum of said reference voltage (Vr) and the intrinsic offset of the operational amplifier. A method as in claim 1, wherein calculations of the offset values for the operational amplifier (2) and of the compensated digital voltage and current values for each sample are performed as 16-bit·operations, whereupon the compensated digital values of voltage and current are converted to 8-bit plus sign numbers prior to their use in the calculation of secondary periodic electrical quantities. A method as in claim 1, wherein the digital current values are memorized in a storage device having a number of memory locations equivalent to the number of samples that can be executed over a period of time corresponding to one quarter of the period of the current waveform, and with the capacity, when required, to supply and simultaneously to discard the digital value memorized first in sequence. An instrument for effecting the digital electronic measurement of periodic electrical quantities in an electronic circuit, in accordance with the method of preceding claims, comprising : at least one operational amplifier (2) with inputs connected to two terminals (3) of the electronic circuit of which the periodic electrical quantities are to be measured, and in receipt of a reference voltage (Vr) of predetermined value such that the transmitted output values are entirely positive; a data processing unit (4) composed at least of a switch (5) or similar electronic circuit capable of conveying signals from several sources to a single user, connected to the output of the operational amplifier (2), and disposed in sequence thereafter, a sample-and-hold circuit (6), an analog-digital converter (7), a memory (8) or circuit capable of storing data, a shift register (9) incorporated into the memory (8), and a timer (13) to generate signals at a constant and predetermined frequency; also a control unit (10) integrated with and governing the data processing unit (4), which can be programmed by software in such a way as to respond, with the instrument (1) activated and on receipt of each signal generated by the timer (13) by executing measuring steps, wherein the control unit (10) is adapted to induce a delay between the conversion of the voltage and the current values (Vi, Ii), and the number of memory locations of the shift register (9) can be defined in such a way that the shift register (9) has the capacity to contain the digital values of one quarter of the samples that can be taken during one complete waveform of the current, and the shift register (9) has the capacity to supply and simultaneously discard the digital value memorized first in sequence, and wherein the control unit (10) executes the steps of: commanding the shift register (9) to receive a maximum number of values equivalent to the number of samples acquired in one quarter period of the current waveform; connecting the operational amplifier (2) to the sample-and-hold circuit (6) and activating the analog-digital converter (7) to obtain conversion of the value of the voltage (V i ) fed to the terminals (3) to a digital value ; memorizing the digital voltage value in a respective first location of the memory (8); activating the analog-digital converter (7) to obtain conversion of the value of the current (I i ) fed to the terminals (3) to a digital value, inducing a predetermined and preset delay (Δt) in relation to the moment of initiating the conversion of the corresponding voltage value (V i ); memorizing the digital current value in a respective second location of the memory (8); multiplying the digital voltage value by 256 and adding the resulting product to the sum of the corresponding products stored in a respective third location of the memory (8), then saving the updated result of the addition in the same third location of the memory; taking the number obtained by multiplication of the digital voltage values by 256, subtracting a corresponding offset value for the operational amplifier (2) stored previously in a respective fourth location of the memory (8) and dividing the remainder by 256 so as to obtain a compensated digital voltage value, then saving this same value in a respective fifth location of the memory (8); multiplying the digital current value by 256 and adding the resulting product to the sum of the corresponding products stored in a respective sixth location of the memory (8), then saving the updated result of the addition in the same sixth location of the memory; taking the number obtained by multiplication of the digital current value by 256, subtracting a corresponding offset value for the operational amplifier (2) stored previously in a respective seventh location of the memory (8) and dividing the remainder by 256 so as to obtain a compensated digital current value, then saving this same value in a respective eighth location of the memory (8); memorizing the compensated digital current value in the first available position of the shift register (9); squaring the compensated digital voltage value , adding the squared compensated digital value to the sum of the previous squared compensated digital voltage values stored in a ninth location of the memory (8), and saving the updated sum in the same ninth location of the memory; squaring the compensated digital current value, adding the squared compensated digital value to the sum of the previous squared compensated digital current values stored in a tenth location of the memory (8), and saving the updated sum in the same tenth location of the memory; multiplying together the compensated digital voltage value and the compensated digital current value, adding the product of the multiplication to the sum of the corresponding previous products stored in a respective eleventh location of the memory (8), and saving the updated sum in the same eleventh location of the memory; multiplying the compensated digital voltage value by the digital current value memorized first in the shift register (9), discarding this same first-memorized digital current value from the shift register (9), adding the product of the multiplication to the sum of the corresponding previous products stored in a respective twelfth location of the memory (8), and saving the updated sum in the same twelfth location of the memory; repeating the procedure of sensing the values of the voltage (V i ) and the corresponding current (I i ) fed to the terminals (3) and performing the above calculations thereon, for a predetermined number of sampling cycles, on receipt in each instance of a signal from the timer (13); and after completion of the predetermined number of sampling cycles calculating the root mean square value of the voltage from the sum of the squares of compensated digital voltage values stored in the ninth location of the memory (8) and saving the resulting value in a respective thirteenth location of the memory (8); calculating the root mean square value of the current from the sum of the squares of compensated digital current values stored in the tenth location of the memory (8) and saving the resulting value in a respective fourteenth location of the memory (8); calculating the value of active power which equals the sum of the products obtained by multiplication of the compensated digital voltage value and the compensated digital current values, stored in the eleventh location of the memory (8), divided by the number of sampling cycles and saving the value in a respective fifteenth location of the memory (8); calculating the value of apparent power which is equal to the product obtained when multiplying the root mean square value of voltage by the root mean square value of current calculated previously, and saving the value in a respective sixteenth location of the memory (8); calculating the value of reactive power which equals the square root of the difference between the squares of apparent power and active power caculated previously, and saving the value in a respective seventeenth location of the memory (8); calculating measured reactive power which equals the sum of the products given by multiplying the compensated digital voltage values and the compensated digital phase-shifted current values, stored in the twelfth location of the memory (8), divided by the number of sampling cycles and saving the resulting value in a respective eighteenth location of the memory (8); calculating power factor which equals the ratio between the values of active power and apparent power calculated previously and saving the resulting value in a respective nineteenth location of the memory (8); calculating the voltage offset value for the operational amplifier (2), which is equal to the mean value of the digital voltage values multipied by 256 stored in the third location of the memory (8) and saving the resulting value in the fourth location of the memory (8); calculating the current offset value for the operational amplifier (2), which is equal to the mean value of the digital current values multipied by 256 stored in the sixth location of the memory (8) and saving the resulting value in the seventh location of the memory (8); wherein the respective mean values represent the sum of the reference voltage (Vr) and the intrinsic offset of the operational amplifier (2); compensating the values of active power and measured reactive power calculated previously on the basis of the error generated by the delay (Δt) separating the acquisition of the values of voltage and current (V 1 , I i ) fed to the terminals (3) of the monitored circuit. An instrument as in claim 4, wherein the control unit (10) is programmed to compensate the values of active power and measured reactive power by multiplying each value with a corresponding compensation factor retrievable from a table of values, stored in the memory (8), which are computed on the basis of the delay (Δt) separating acquisition of the values of the voltage (V 1 ) and the corresponding current (I i ) fed to the terminals (3). An instrument as in claim 4, comprising a plurality of operational amplifiers (2), each with a rated gain different to that of the other amplifiers and connected electrically to one respective input of the switch (5), wherein the switch (5) is piloted automatically and independently by the control unit (10) in such a way as to activate the connection between one of the operational amplifiers (2) and the sample-and-hold circuit (6) on the basis of the value of the signal measured during the previous sampling cycle and of the rated gain of the respective operational amplifier (2). An instrument as claim 6, wherein the plurality of operational amplifiers (2) are comprised in one multiple operational amplifer. An instrument as in claim 4, wherein the sampling operations are repeated by the control unit (10) cyclically over periods of time predetermined as multiples of the period characterizing the periodic quantity to be measured, the period of the measured quantity being the time taken by that quantity to return to a regularly recurring value, in such a manner that each predetermined period of time will compass a whole number of waveforms of the periodic quantity to be measured, whilst the frequency of the signals generated by the timer (13) is such that the number of signals generated during each of the predetermined periods of time will be divisible both by four and by the whole number of waveforms of the monitored periodic quantity contained in each of the predetermined periods of time. An instrument as in the preceding claim, for the measurement of periodic electrical quantities in a.c. circuits of 50 Hz or 60 Hz frequency, wherein the sampling operations are repeated by the control unit (10) cyclically for periods of 100 ms duration and signals are generated by the timer (13) at a frequency of 2400 Hz in such a way that the control unit (10) will execute up to 240 sampling cycles in each period of 100 ms. An instrument as in claim 4, wherein the delay (Δt) generated by the control unit (10) is equivalent to the sum of the time needed by the analog-digital converter (7) to convert the analog voltage value (V i ) registering at the terminals (3) of the monitored circuit, and the time taken by the control unit (10) to execute a predetermined and constantly repeated number of operations.

Inventors: MAZZONI ERMINIO, MAZZONI, ERMINIO
Applicants: ELECTREX S R L, ELECTREX S.R.L.
Application year: 1993
Main classification: G01R19
IPC codes: G01R21