The present invention relates to a method for the digital electronic measurement of periodically varying electrical quantities, and to an instrument for its implementation. 
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.  Quanities 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, since 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.degree.  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.