Ultra fast frequency independent instantaneous power factor detector

Many schemes were attempted to lessenthe time taken for measuring thepower factor of a linear load. This paper suggests taking advantage of aprevious paper where only two samples of the voltage and current wereadequate to have a very fast calculation method of the power factor. Thatscheme used a phase locked loop (PLL) as a frequency multiplier scheme toacquire two progressive samples of the voltage and current which areconcurrent. The time elapsed for measurement was the reciprocal of the PLLsampling frequency; no further scheme was reported after that to claim afaster method. This paper gets use of that work to get two progressivesamples of voltage and current separated by a short time. The scheme isfrequency independent with an indication for lead lag. All the operations areexecuted by a PIC microcontroller rather than a computer with few supportcircuits. The output will be shown either in digital or analogue (DC) form.The percentage of error depends mainly on the resolution (number of bits)for both the ADC and DAC used.


INTRODUCTION
The power factor measurement is important issue and there is always a need of a device which can directly give a linear output dc signal proportional to the power factor magnitude.
Many attempts were strived to measure the power factor of a power line frequency load [1][2][3][4][5][6][7][8][9]. All of these methods took at least one cycle of the power inputs to detect the power factor. A half a cycle of the input power line frequency measurement time was reported in [10][11][12][13][14]. The execution time was diminished to a quarter a cycle in [15]. The time was further reduced to three consecutive samples by [16]. This was developed later by Al-Khalid and Omran to reduce the number of samples needed to only two [17]. Using microcontroller in measuring the power factor was illustrated in [18][19][20].
This paper intends to get use of the work in [17] by letting a microcontroller rather than a computer to accomplish frequency independent detection. In this case the scheme will be appropriate for portable usage putting in mind that the result will be given in digital and analogue (dc) form. So, the detector will be suitable for on line measurement or using a d.c voltmeter. The scheme is intended for undistorted signal (no harmonics are present). The transient response time of the proposed method is ultra-fast and will be limited only by the lowest sampling time of the ADC module and the measured value will present the instantaneous magnitude of power factor with an indication to whether the power factor is lagging or leading. ( 1 ) 2 ( 2 ) 2 ( 3 ) Figure 1. Voltage and current samples The two current samples i1 and i2 can be written as follows: Where θ is the phase angle between the voltage and the current signals.

1963
Squaring both sides of (8) and solving for the power factor (cosθ), where 1 (10) Ψ can be calculated from (1) and (2) as follows , With a constant value Vm, the power factor can be calculated depending only on samples v1, v2 and their corresponding current samples i1, i2 and the proposed system will be updated if any change occures in Vm value to prevent any possible error in calculated power factor as will be described later. If the value of v1 or i1 was taken at zero crossing (their value is zero) in this case the value of K1 is undefined.
Using the same procedure used previously in obtaining (9), we get that, It is clear from (15) that the power factor is calculated in this case from only current samples.
Now, doing the same sequence used in (9) for finding the power factor (cos θ), It is clear from (17) that the power factor is calculated in this case from only voltage samples.

HARDWARE IMPLEMENTATION
The system block and circuit diagram are shown in Figure 2 and Figure 3 respectively. The microcontroller used is PIC18F45. Full description of the required conversion time was reported in [20]. Two non inverting operational amplifiers, level shifters are used to convert a positive to negative signal into a range suitable for the ADC.
Peak detector is used when we have a rapidly changing AC input signal, and we want to obtain the peak voltage that the signal reaches. The peak detector is used with precision full wave circuit in order to detect both the positive and negative peak value of the AC voltage source. Also, it is possible to give a lead lag indicating signal by using the D flip-flop function that implemented within the microcontroller program. Where in cases of leading angles gives positive pf and lagging angles negative pf.    Figure 4 shows the flowchart for the calculation of power factor. This program was written in C Language, using the mikro C compiler (mikroElektronica). The power factor C program, contains the functions that initializes the microcontroller, acquires the two samples from the input voltage signal and the corresponding two current samples, the input from peak detector, calculating the value of ψ using (11) and calculating the value of K1, K2 or K3 using one of the three cases according to (10, 14, and 16). The range of PIC18F452 ADC channels is always positive so that we need to recognize the negative values of voltage and current samples. This accomplished by changing to the negative sign of any values less than 512. The final value of power factor achieved using one of three (9, 15, and 17).

EXPERIMENTAL RESULTS
An Ultra Fast Frequency Independent Instantaneous Power Factor Detector is implemented as proposed in previos sections. It is clear from the results shown in Table 1, that the theoretical and the practical results are very close. The difference between the theoretical and the practical results are because of the limitation of the ADC and the resolution of the 10-bits DAC used in the microcontroller. Figure 5 illustrates the frequency independent facility of the designed detector. As shown the performance of the detector is unaffected by the frequency of the input voltage and current. In comparision with other papers speed was not put into account in [18], while special care is realized to adjust the output of the PLL concerning maximum expected peak of the input voltage (current) and to be in phase with the input [20]. Nothing was mentionsd about speed in [21][22][23].
The first sample it was neglected if it occurred to be of zero value as explained before. Other sample values can be tackled remembering that a 10-bit ADC is available with full range input of zero to +5v.

CONCLUSION
A new ultra fast frequency independent instantaneous power factor detector is described. The proposed detector required two progressive samples of the voltage and current separated by random short time. The proposed method is implemented based on microcontroller with few support circuits. The high-frequency limit is determined mainly by the maximum sampling frequency of the ADC. The developed detector is highly reliable and possesses enough flexibility to suit the requirement of frequency-variant systems.