Power factor/ frequency / true rms measurement of a 230V AC 50hz signal

hey People ! For my engg final year project i am in a dire need of figuring out ways to measure power factor and the rest of these
paramaeters using a microcontroller ..the one i hav selected is dsPIC30F6014 . Plz can somebdy direct me to the algorithms needed for these? For frequency i guess i can use the DFT interpolation or zero crossing detection method and stuff ..but for the power factor i hav absolutely no threads !! I wud b really grateful if smbdy cud help me out with this.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
chetanthegreat wrote:

Are you sure that engineering is really the career for you? You may find that you will be entering a profession where there are already more than enough people with your intelligence and skills, remarkable though they appear to be. It may be rather difficult, if you find a paid job, to have to tell the boss that he will have to wait for the solution whilst you ask for help on the internet...
This seems a very trivial problem for a final year student. You are sampling the signals in the time domain. A simple transform to the frequency domain will give you some of the outputs that you want. Cross-correlation will give the others.
You shouldn't need a thread to explain power factor - as a final year student you should know what power factor is and how to determine it, given a current and voltage waveform, even it it is initially presented to you as a train of samples.
--
Sue






Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

To the original poster:
I would only add that if you want to seek gainful employment in a country where English is the primary language, you should avail yourself of some of the remedial instruction available at your school. Learn to spell, type, and use complete sentences and then try asking your question again. I do not provide assistence to those who do not care enough about what they are doing to attempt clear communication. And "no", it does not have to be perfect; just show that you have made an attempt at communication.
Charles Perry P.E.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Charles Perry wrote:

@ Charles
I would like to start by apologising for the casual language used in the original post. I am trying to reframe the problem in a more palatable manner here. Hoping you will find it worthy of your consideration. Basically I am set out to build a power analyzer, which will include :- -1 phase supply monitoring- -Surge detection capabilities of the order of 10 microseconds -Data logging at configurable intervals -Current harmonics distortion calculation -Measurement of parameters -True rms I & V, KVA, KVAR , cos(phi)
I need to find out how to measure the power factor from the AC mains supply using a DSP microntroller and MATLAB for demonstration purpose. So far I have reached a stage where I can acquire data using a conditioning circuit which includes a CT and a PT, followed by Instru. Amp. I tried looking for algorithms foe measurement of these factors over the internet but didn't get any threads on the PF front. I would be really grateful if somebody could help me out with this. Thanking you in anticipation.
Chetan.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Palindr☻me wrote:

@ Sue
First of all, I would like to apologise for my ignorance about the fundas of electrical and my poor communication skills as far as English is considered. As for the facts, you think should be "OBVIOUS" for a final year student of engineering, I am sorry to say, but I can hardly think of anybody including my professors with a really few exceptions, to whom these might be "OBVIOUS". If you read carefully, I don't want to know what power factor is, but I want to know how to measure it using a microcontroller like dsPIC30F6014. Correct me if I am wrong, but can I use the timers to count the delay between current and voltage waveform's zero crossing? So that after converting that time duration into phase angle and calculating cosine of the same I can find out the power factor.But again that raises the question of how do I calculate Distortion and Displacement PF separate|? Besides this method is basically implementable on a simple 8051 based uC too, So what is the value addition using the powerfull processor with DSP core then? Thanking you in anticipation.
Chetan.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
chetanthegreat wrote:

I did give you suggestions on how to do it. By taking two trains of samples in the time domain and feeding those values into your DSP, you calculate the frequency domain equivalent. That allows you to get a very accurate measurement of both fundamental frequency and distortion. Plus a harmonic analysis of that distortion, should you need it. By cross-correlating the two trains, you get the time displacement between them, which then gets you the power factor. A DSP is ideal for performing transforms and correlation..A GPU is not. Simple measurements of crossing points, averaged over a long period and for constant waveforms, will give accurate results. Using transforms and correlation will give results in a fraction of a second, rather than seconds. The algorithms for Fourier Transform and Cross Correlation, you should already be familiar with.
--
Sue









Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I guess I can measure power factor by a method I thought of. Of course, based on only on the principles that I know. In MATLAB, the stepped down and conditioned signal is aquired and stored in an array. The voltage and current arrays are then phase plotted and the phase plot is stored in another arrays. Then the difference between the fundamentals of these are phase plots is calculated. This difference when operated with cosine function should give the normal PF. Please suggest any inconsistancies or flaws in the method. As for the implementation on the dsPIC itself I think the same principle can be modified somehow and the task can be achieved.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
chetanthegreat wrote:

Yep, it reads like you are getting there. You bring the samples in and store them in arrays, then start doing matrix algebra on the arrays, using the DSP. I would suggest that you apply cross-correlation first, as it is the easiest to do and to understand and to verify that your system is working accurately. It should also be a confidence boost - as there is nothing quite like actually getting what appears to be valid results from a project..
--
Sue

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
An important consequence of the realization that cos(Phi) and PF are not synonymous is in instrumentation, i.e. how we measure power factor. In the power industry power factor meters are quite common. The misconception about cos(Phi) goes so far that many meters are actually labelled "cos(Phi)", perhaps because it looks more technical than Power Factor. Many very expensive instruments have absolutely nothing in their specifications to define exactly what it is they measure. Imagine: An instrument could be designed which merely measures the phase angle using zero crossing detectors. This could be labelled cos(Phi) and sold for a lot of money. We don't know if this has ever been done, but would not be surprised to discover that it had. Do not trust an instrument if you don't know exactly what it measures One excellent instrument is the Fluke Model 40 (we are not in any way associated with Fluke, but have used the Model 40). This instrument is for use on mains circuits at 110V and 240V 50/60Hz. It has a voltage input and a current clamp. Internally it uses a DSP chip and carefully synchronized dual A to D converters to analyse the voltage and current waveforms. It displays harmonics of current and voltage up to 31st harmonic. Fluke define two separate power factor measurements: Displacement Power Factor (DPF) and plain Power Factor (PF). DPF is the cosine of the phase angle between the fundamental frequency components of voltage and current. The Model 40 actually mathematically extracts the fundamental waveforms from the inputs and then measures the phase angle between them. In the Model 40, PF is the true ratio between VA and power with all harmonics factored in.
Is this a better method to do it? or wot i am doin is allright??
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
chetanthegreat wrote:

I have absolutely no idea of what you are doing, let alone what you plan to do.
If this is an undergraduate final year project, then the objective is to demonstrate that you can apply the principles of engineering that you have been taught and can demonstrate a reasonable understanding of them. What exactly you produce and even whether it works is relatively unimportant - provided you can explain what it is and why it doesn't work...I've known final year projects that have got the student a first class honours project mark and consisted of little more than a signal diode linked to test equipment..
What you have described above, using AD conversion and feeding the samples into a DSP is basically what I suggested that you consider doing in your DSP-based project..
--
Sue



Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Palindr☻me wrote:

@Sue
Though this is an undergraduate level project, it is being sponsered by a company which deals with power electronics equipments. So basically the ultimate use of the product is going to be done in an industry. So I wish to try to make it as competant as possible considering that. But thankfully their requirements aren't much considering the other ready-made products available in the market. Hence I want to reconsider every algorithm/design methodology I am going to implement beforehand to achieve good results. I want to know whether this ADC interfaced to PC method is going to fulfill these requirements good enough.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

This is unnecessarily complex, and would only give correct answer for sinusoidal wave forms. For other waveforms, PF=cos does not apply.
Having got your voltage and current arrays, create a power array by multiplying them together. Then work out the RMS value of the voltage array and the RMS value of the current array, and multiply to get the VA. Power factor = Power/VA. This will work for any waveform shape.
--
Andrew Gabriel

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@cucumber.demon.co.uk says...

You don't even need the arrays. Simply do the arithmetic on running samples. ...or spend the $30 for a Kill-O-Watt and take the guts out. ;-)
-- Keith
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Andrew Gabriel wrote:

Please forgive for dumbness, but how do I calculate the POWER for the PF=power/VA equation? Tell me if I am wrong.. First true rms current and voltage values are calculated for a windowed sequence which will be the VA. and for the apparent power, the averaging of the power array will do the job. And then simple division of these two will give the result, i.e PF.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@gmail.com says...

Yes
Where the "power array" is the V * A for each time slice. You really don't need arrays though. The math is simple to do on the fly. You never have to look back in time so there is no real need to keep the data. Simply keep a running RMS(V), RMS(A), V*A, and number_of_samples values. Capture and reset the values at every other zero crossing. If your zero crossings are flaky you can average across more cycles.

That's all there is to it. It works for any waveforms, unlike cos(theta).
-- Keith
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.