Design Choice Harmonic metering "Power Meter" - Page 1
Forum section: electronics / projects

author: scarrier
author_rank: Contributor
timestamp: February 10, 2013, 06:51:09 am
content: I am student and i am starting a project.The project is a power meter 3 phase metering current and voltages on all phases. I want to be capable of metering the first couple harmonic level precisely enough. I am struggling to choose the strategy to use i am thinking of an fpga for the 6 simultaneous fft's and a 6 channel ADC simultaneous sampling (because i want to measure the power factor to...). The other option is the same ADC with fft's in a fast micro controller (32 arm).I have done little FPGA and have trouble sizing the size i would need for only 6 simultaneous fft's.Would a fpga would be viable at all with a soft core in it to do all calculation and drive the lcd and serial port and couple of button for minimal menu navigation. There again what size fpga would i need?Thank you for your opinion

author: cyr
author_rank: Frequent Contributor
timestamp: February 10, 2013, 07:45:12 am
content: Sounds like massive overkill to me, FPGA:s are great when you need to deal with hundreds of megasamples per second but surely you only need to see signals up to a few kHz at most?I would look at something like dsPIC, a $5 micro could probably do both the sampling and the processing.

author: nctnico
author_rank: Super Contributor
timestamp: February 10, 2013, 02:39:31 pm
content: Look for an ARM Cortex microcontroller. Most have ADCs that sample up to 1Ms/s. Even divided by 6 channels that is still over 150ks/s which is more than enough. I'd use a sampling frequency around 10kHz and then decimate. Also be sure to look into the frequency ranges used for signals modulated onto the mains like X10. Filter those either analog or digital.

author: scarrier
author_rank: Contributor
timestamp: February 10, 2013, 03:56:09 pm
content: I see what you are saying FPGA even a small one is probably over kill. The reason i am thinking of external adc something like ADS8556IPM is that the sampling is simultaneous and the input range is +/- 12 V witch simplifies the circuit because there is no need to offset and...

author: Bloch
author_rank: Unknown
timestamp: February 10, 2013, 06:29:32 pm
content: Quote from: scarrier on February 10, 2013, 06:51:09 amWell the norm is to start with some kind of specifications on the end product

author: scarrier
author_rank: Contributor
timestamp: February 10, 2013, 08:56:40 pm
content: This is a personal project so there is no strict define specification.There is plenty things i want to measure like TRMS... but harmonic is the part I am the most struggling on. I would like ti have a 1% error on harmonic level over 15 first odd harmonics input signal is 120v or 240v 3 phase and ct input for current 5 amps.Obviously the challenge of measuring harmonic is to find the good technology so that there is not too much noise introduce because noise can difficultly be filtered considering that is part of what will be measured.

author: Bloch
author_rank: Unknown
timestamp: February 11, 2013, 06:33:15 pm
content: Ok scarrierNow there are some thing to talk about.But i am not sure how much help you want / need.QuoteSo how fast AD converter do you need ?

author: fcb
author_rank: Super Contributor
timestamp: February 11, 2013, 09:15:41 pm
content: So you want to measure the first 15 harmonics of three phase voltage & power?The minimum sample rate will be:60(Hz) * 15(harmonics) * 2(Nyquist) * 3(phases) * 2(voltage&current) = 10800 samples per second.If you use a DSP PIC (say the dsPIC33FJ128GP302), it can run 4 sample/holds at the same time, or use the 12bit converter and DMA to automate the process. Either way it can run between 500KSps and 1.1MSps.If you want much higher resolution, then you could use 3 cheap 24bit stereo ADC's running at perhaps 32KHz. That's a bit more complex to do, but I've linked a low end dsPIC with more channels than that at higher speed. But FFT's at this speed are not trivial on small dsp's.Even if you have a single ADC & multiplex the front end - if you run it fast enough it won't make any difference to the end results.I'd build the FFT and phase detectors first and see how fast I could get 6 of them running in parallel and what the RAM requirements are, then worry about the sampling regime.

author: krish2487
author_rank: Frequent Contributor
timestamp: February 12, 2013, 12:00:40 am
content: If it is a one-off and a personal project..I d rather choose a dedicated high-end power analyzer IC and build my hardware around it.I worked with maxim MAXQ3180 and it is a quite an advanced device to start off with...Unless of course youwantto do all the work yourself in which case, a high end dsPic or a mid end ARM would do fast enough.Of course.. as fcb suggested it is not trivial even with a dsPic.You ll probably need to code in assembly to get what you want.

author: nctnico
author_rank: Super Contributor
timestamp: February 12, 2013, 12:16:08 am
content: I doubt you need the FFTs. 15 filters would be enough which are quick to calculate.

author: fcb
author_rank: Super Contributor
timestamp: February 12, 2013, 12:27:29 am
content: krish2487:That MAXQ3180 seems to do it all, impressive stuff. I guess it's down to what you want to gain from a project.I'm not sure I would discourage people from writing in assembler - I still write everything in asm after 20+ yrs with PIC's.nctnico:Filters, sure. Biquad's would work well, and simple to code and test, you could also grab a block of samples and process them with one filter and change the co-efficients. Not sure you'd gain in speed over an FFT.

author: krish2487
author_rank: Frequent Contributor
timestamp: February 12, 2013, 03:41:26 am
content: @fcbI apologize if it seemed offensive about assembly as choice of programming.I meant that, if it is a project then there will most likely be deadlines to deliver and a steep learning curve for assembly programming.and yes, regarding the MAXQ3180. It was not a project for me.It was the first embedded systems product I worked on after I was fresh out of college and got into a job.I had to design hardware and develop code for a 3 phase front end lcd display for a 45 KVA UPS which had to display all the parameters that a energy meter would.Of course, minus the Kilowatt hours etc etc. The primary reason why I went with MAXQ3180 was that at that point of time it was the only chip on the market to measure power factor (I am talking about 3.5 ~ 4 years ago)Most of the intelligence is built into the chip anyway. Just the interfacing and parsing had to be done with care..It wasnt all smooth sailing though... I did have my share of "bang-the-head-against-the-wall" moments..I did gain experience of how to deal with frustration!!!:-P@OP : Sorry for reminiscing and hijacking the thread.

author: fcb
author_rank: Super Contributor
timestamp: February 12, 2013, 09:50:40 am
content: krish2487: no need to apologize, i'm not easily offended.I think it boils down to what the OP wants to do, if it's a commercial project that has various development costs and risks associated then you'd be crazy not to look for a block that does it all. But from what the OP has said, looks like there is no functional spec, and it's just something they want for 'fun' - in that case, the journey to the solution is as important as the arrival and maybe more enjoyable to do this from scratch.Code in whatever language you like and feel comfortable with. When I started with PIC's in the early 90's there was only assembler and the 16C54-16C57 parts available. I remember the 'excitement' of the 16C71...

author: scarrier
author_rank: Contributor
timestamp: February 13, 2013, 12:46:22 am
content: HelloI have considered the MAXQ3180 and the ADE7880 i think these look like very good chip that do a lot of the computing but they don't seem to give the level of each harmonic and the true rms value that i want. So if i have to have an adc i rather do all the ciomputing in my microprocessor. 15 filter could be an idea but it is 15 filter oin each phase and on current and voltage so this means 6 x 15 filter this is long to compute and not a lot quicker to compute than an 6 fft i thinkfcb :the 15th harmonic is number 31 so : 60(Hz) * 31(harmonics) * 2(Nyquist) * 3(phases) * 2(voltage&current) = 22320 samples per second.I understand this is not very quick but if i am to take an external adc there is the communication time between the sampling and the reciving from microcontroller witch can be long if ther is for example 6 time 24 bit (a lot of 6 external chanel simultanous sampling adc that i found are delta sigma 24 bit adc's).For programing language a lot of fft code for dsp are already wrote in assembly but I hope not having to do a lot of assembly of my own because Ihave done some but i woul struggle to do complicated codeThank you for your comments and help

author: fcb
author_rank: Super Contributor
timestamp: February 13, 2013, 01:16:00 am
content: Whether you want 31st harmonic or 310th harmonic, your still well within the capabilites of ADC's onboard microcontrollers.Interfacing external ADC's to modern micro's is trivial (if you set them up right) - using DMA can help.Again, i'd get the toughest %-B bit done first and get your FFT running. Example FFT's published by Microchip would probably have enough resolution for what your doing already.