I'm working on a new project that I would like to share with this community. For now, I called it "JMPM".
It's a power monitor similar to the designs here, but based around more mordern components.
The design goals are simple -- I want a highly accurate device for measuring my home's energy use and production.
JMPM is based on the Xmega series of uC by Atmel and as such:
The design target for this is to have it work with emoncms as the front end. I took a look at that and it's pretty darned complete.
The board powered up for the first time last night. Once it's proven to work, I will publish everything as an open design and open source.
Huge thanks to everyone here for inspiring!
That looks good.
See my post about EmonLibPro http://openenergymonitor.org/emon/node/2406
May be usefull to you.
For improovement, i'd like to see an ethernet port in it to comunicate directly to emoncms as i'm doing with arduino. :)
Looks really good! nice work! Love the purple boards. I look forward to seeing the schematics, are you using similar input stage circuitry to emontx or different?
V0.01 uses nearly the exact same input stages as described here. I have v0.02 in the works right now. that includes an anti-aliasing filter to improve ADC accuracy and an option for direct (transformer-free) measurement of line voltage. Transformers are difficult to reliably source and expensive when they can be found.
Also considering adding an rf transmitter to the board layout since that'll be nearly free.
I'll be interested to see what difference the anti-alias filter makes to the low level performance and noise rejection.
How do you intend to handle the necessary isolation if you will be having a direct galvanic connection to the line for voltage monitoring?
nyquist frequency theorem says the sample rate has to be at least twice the highest frequency being measured. With my scope and a ct probe, I can see details around 30khz and I have only looked at my laptop power supply and a small desk fan. I'm sure higher frequencies are present and even more noisy with larger and composite loads.
Additionally, if there are enough cycles to perform reliable over sampling, the signal can't change much during the extended sample period. I don't think the 12bit adc is nearly good enough for measuring the 200amp sensors with any reasonable accuracy.
Unfortunately my ct probe came after the boards were sent to be fabbed, so I didn't think to add the filter to the first design.
Anti-alias filter in hardware? I see that as a shortcut with precision reducion.
Typical LPF DC offset filter should account for high frequency content removing.
If you want reliability and precision you should:
1 - Eliminate digital noise from analogic section.
2 - Sample values ranges close to max precision of adc. If needed much range, hardware gain must be considered. From atmel appnote it exists onchip on XMega so use it.
3- Sample as fast as possible. (include cpu processing time)
4- Assure you are sampling at the same time position in every cycle. (call for PLL)
5- Continuou sample and never miss any sample at any time.
6- Do the filtering in software.
7- Give result data as an average over time of sampled data.
What exact XMega are you using at what freq? ATxmega128 is only twice as fast as arduino Atmega328 in cpu raw power.Not realy enought for what you describe you want to do.
You should revise your cpu software processing power required as no way you can get your "80th harmonic in real time" measurements with this for 11cts.
See Atmel AVR1631: Single Phase Energy Meter using XMEGA A http://www.atmel.com/Images/doc42039.pdf
As i said on the post above, see my lib, it does pretty much all the necessary steps i said minus step 2, but i'm using 20A/ CTs so range is short.
Noise is my main problem with arduino shield proto boards as pcb layout is bad designed for analog signal. Even though i got 0.01-0.25 precision on all units.
With a precision for step 4 in range of 39-78uS with the PLL technique.
Take time and analise it, you wont regret.
Is there any other way? ? ?
"Typical LPF DC offset filter should account for high frequency content removing."
Please explain. You need a HIGH PASS filter to remove the d.c. content, else you obtain the d.c. content with a low pass filter and subtract it. Either way, the high frequency content is largely unaltered.
Robert Wall :
First to clarify, high frequency 'noise' (in MHZ) is not the same as (not so) high frequency current peaks (eg.: from smps).
I tought that hardware anti-aliasing filters was used to remove the later peaks, but from viewing the atmel AVR1631 app note i believe that filters are there to remove high frequency noise from the line like the generated by powerlan devices in MHZ ranges.
Meaning that this kind of filters will not do much change with arduino like ADCs because itself works by sampling a small window (at 125khz for arduino). So any higher frequency content is lost already.
Regarding LPF for DC ofset, forget it we use a HPF. My mistake.
For LPF in software it can be implemented with a formula like:
y(n) = 0.996 * y(n-1) + x(n)
Aurduino isn't a development target for this project.
I am well aware that digital noise originates from a different source, and is unwanted, compared to high frequency Fourier components of the wanted input. However, a passive anti-alias filter, which will of necessity remove high frequency components of the wanted signal above the Nyquist frequency, might also serve to remove some of the noise components, especially those that are inductively or capacitively coupled, as opposed to conducted, into the input (or indeed conducted into the analogue supply).
For good low level performance, you must have a clean analogue supply (an L-C filter L50 - C50 is shown in the Atmel app.note AVR465 and similarly in other Atmel documents), and if there are components in the input above the Nyquist frequency, then hardware anti-alias filters are required. However, the limited bandwidth of the current transformer, and the very low level of high frequency components in the voltage supply are probably reasons for these not being included in the Atmel AVR465 design. It is of course quite impossible to have a digital anti-alias filter.
chaveiro - I appreciate all your feedback. This is good information. I'll review the utility of all your points with the design.
I'll include ethernet into v0.02. That's really a very good idea and something I hadn't considered.
Additionally, re: 80th harmonic -- My consideration is much of the processing can be offloaded for high precision heavy lifting. In this use case, the device just sends raw data in a periodic packet and something else can do the analysis. Moving this much data in and out of the uC will be enough work.
Tweets by @Openenergymon
Open-source tools for energy monitoring and analysis. This project uses the GNU General Public Licence