Author Topic: mains power measurement (again)  (Read 1774 times)

0 Members and 1 Guest are viewing this topic.

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
mains power measurement (again)
« on: November 05, 2017, 11:45:54 am »
It seems every couple of years I want to measure the power consumed by mains devices.

A few years ago, I built a one-off that used a CT for current measurement, and the output of the power supply transformer for voltage measurement, going into the ADCs of a micro. It worked OK, but was a bug bulky mess because of the transformers.

More recently, I used an Allego hall effect device to measure current, and just assumed the voltage, for a crude device for power measurement (well, apparent power).

I've been looking at energy measurement IC's like this one: http://www.atmel.com/Images/Atmel-46002-SE-M90E26-Datasheet.pdf. It has many things I want: it has the ADCs built in, so I can just talk to it i2c/SPI, and it is designed to work with only a shunt resistor for current a voltage divider for voltage, and it can handle the negative swing of the voltage rail. But I wonder -- what is the proper way to hook one of these up to a uC? The chip must be floated on the AC neutral, which if I'm to directly connect to a uC, then that must share the same power rails. But I really would ilke isolation between the AC and my uC. I could isolate a SPI interface pretty easily, but then I still have to power this chip. Do I use some reasonable isolated power supply for the rest of the design and a crufty capacitive dropper type PSU just for this chip?

My design criteria are isolation, simplicity and compactness first, with price a second.

How do people who know what they are doing build isolated power meters?
 

Offline ovnr

  • Frequent Contributor
  • **
  • Posts: 658
  • Country: no
  • Lurker
Re: mains power measurement (again)
« Reply #1 on: November 05, 2017, 11:55:46 am »
"It depends".

You could have the micro on the mains side too, and just isolate the comms to/from that. There are also SPI and I2C isolators. Incidentally the device you linked does SPI and RS232, not I2C.


If you just want a simple solution: Grab something like the ADUM5211 for RS232 or ADUM5411 for SPI. They provide 30mA of isolated power (plenty for a energy metering AFE) + signalling, all in one chip.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 8995
  • Country: us
Re: mains power measurement (again)
« Reply #2 on: November 05, 2017, 12:15:00 pm »
Why wouldn't you use a Kill A Watt? It must surely be cheaper than anything you can make yourself?
I'm not an EE--what am I doing here?
 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #3 on: November 05, 2017, 01:55:51 pm »
Why wouldn't you use a Kill A Watt? It must surely be cheaper than anything you can make yourself?

I need something that I can physically embed in existing small appliances. This is for an instrumented kitchen/home science project. I don't want a meter hanging off the plug and I don't want a display.

I've seen the kill-a-watt devices modified and the process looks pretty janky to me. And the guts of the kill-a-watt have changed more than once; your can't crack one open and already expect it to be a certain way
 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #4 on: November 05, 2017, 02:00:00 pm »
"It depends".

You could have the micro on the mains side too, and just isolate the comms to/from that. There are also SPI and I2C isolators. Incidentally the device you linked does SPI and RS232, not I2C.


If you just want a simple solution: Grab something like the ADUM5211 for RS232 or ADUM5411 for SPI. They provide 30mA of isolated power (plenty for a energy metering AFE) + signalling, all in one chip.

That chip looks brilliant!
 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #5 on: January 10, 2018, 04:54:18 pm »
I am back to this project. Looking at the Adum5411 again. It seems to be out of stock at Digikey and Mouser. I'm looking at the TI ISOW7841 instead. They look to be about equivalent.

Does anybody have experience with either? Both are pricey.
 

Online prasimix

  • Supporter
  • ****
  • Posts: 1101
  • Country: hr
    • EEZ
Re: mains power measurement (again)
« Reply #6 on: January 10, 2018, 09:13:44 pm »
Maybe a little bit cheaper could be using some of digital signal isolator with separate power isolation based on e.g. SN6505. It's stocked on Digikey as the required push-pull transformer.
 

Offline splin

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: mains power measurement (again)
« Reply #7 on: January 11, 2018, 02:30:21 am »
Just get one of these 1W dc-dc convertors and some cheap optisolators:

https://www.ebay.co.uk/itm/New-Z3-B0505S-1W-DC-DC-5V-Power-Supply-Module-4-Pin-Isolated-converter/192339333650?epid=13007575701&hash=item2cc8515212:m:mCCj2bHRZtuPw9Pw2eiPMLQ

Make sure you meet the minimum load spec for the convertor (perhaps 10% or 20% full load) or the output voltage won't be regulated and could get excessive.
 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #8 on: January 11, 2018, 04:07:12 am »

Wow, on the 5V/5V isolatd DC regulator. Same (similar?) part on legit supplier site is like $6. (Recom 0505S).
 

Offline splin

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: mains power measurement (again)
« Reply #9 on: January 11, 2018, 10:19:04 am »
Mornsun is a big Chinese manufacturer so it's not too surprising their convertors are cheaper than US or European manufacturers. I have no doubt that their products are good quality and perfectly safe. But caution is required, as with any safety related goods bought from an unknown Chinese vendor, given the amount of fake products on the market.

To be certain you'd have to get several and dismantle one or more (might be potted so could be difficult) to check creepage/clearences and the transformer windings are safe, or at least do a hi-pot test. Hardly worth the effort

On reflection I wouldn't risk buying on Ebay/Aliexpress etc. This distributor is selling them for $1.85 each and claims to be an authorised seller.

https://ttlelectronics.net/products/b0505s-1wr2-ic-dcdc-converter-1w-5v-sip

I've no idea if they are a reputable supplier but I'd trust them far more than a Chinese Ebay sellor.

Better still I see Digikey sell a Recom part for $2.64 - not a big premium when someones life could be at stake:

https://www.digikey.com/product-detail/en/recom-power/ROE-0505S/945-1655-5-ND/3461632

[EDIT] There definitely are counterfeit Mornsun products out there (no surprise):

http://www.mornsun-power.com/html/about/content/1800276.html

http://www.mornsun-power.com/html/about/content/1800444.html
« Last Edit: January 11, 2018, 10:32:51 am by splin »
 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #10 on: January 25, 2018, 05:25:10 am »
Thanks for the help with this project so far.

I got my boards back and they work just fine. I tested them at first with a 24VAC sprinkler transformer, then I went up to an isolated mains transformer, and eventually with direct mains, taking the load all the way up 1500W. No smoke!

I know you guys know a lot about this sort of project, but here are some of my thoughts/learnings:

* I decided to use the ISOW7841 because of the simplicity of only one part, and it works fine and required zero debugging. Though I will be making a bunch (maybe a few tens) of these, the number is not so high that the price is that important.

* My AFE is an ATM90E26. I stuck with the reference design concept, in that they put the mains "live" onto the "ground" for the AFE chip. I understand that I could have just let the CPU ride the mains along with the AFE, but I decided to isolate it, mostly because of ease during debugging. If I want to probe something on the CPU side of things, there's no fuss. Same with programming headers, etc.

The uC side of things, by the way, is alternatively an Atmega328P which bridges between the AFE and a Raspberry Pi Zero W, or I can leave the atmega out entirely and talk to the the RPi directly. I thought I'd have the uC there in case I needed to do any real-time processing, but because the AFE integrates energy for me, there's little need for it, so I think I will spin the board again without the uC

* If you want to get close to the promised accuracy, I need better tools for calibration. I used a single Fuke 87V to calibrate the voltage and current, with various "handy" loads, I had laying around: 800 ohm WW resistors, 40 W lightbulb, 150 W lightbulb, and 1500W space heater. All those loads have imperfect power factor and also change with their temperature, which obviously changes. One thing I noticed is that as I varied the loads, the voltage would change, so I really needed to voltage and current simultaneously, which I could not do. Also, mains voltage just varies a bit minute by minute on its own. Complicating matters further, I really need good measurements directly across the shunt in order to calibrate the energy metering (as opposed to just the Irms and Vrms measurement) and that's also not easy. One mistake I made was not putting test points for the shunt.

So now I want a programmable AC load and a programmable AC source. Too bad I don't have funds for that!

* In my boards, I only did the shunt measurement and left the CT measurement off entirely. I'm thinking of putting the CT onto a new board, probably use a CSE187L. But I'm not sure I need it. The AFE chip is designed to measure a voltage across a current shunt and from a CT. This is for tamper protection, mostly. You can put it in a mode where it alerts if one is missing, or it chooses whichever is larger. I don't need this. My main reason to consider the CT is that maybe it's more accurate than the shunt? Maybe not?

Okay, enough for now.

 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 7473
  • Country: us
  • DavidH
Re: mains power measurement (again)
« Reply #11 on: January 25, 2018, 04:26:05 pm »
You could power it with an isolated high frequency inverter, or a small power transformer, or even with a series capacitor directly from the AC line if its current demands are low enough.
 

Offline jbb

  • Frequent Contributor
  • **
  • Posts: 476
  • Country: nz
Re: mains power measurement (again)
« Reply #12 on: January 25, 2018, 08:59:34 pm »
On the CTs vs shunt resistors:
For small currents (< 5A I guess) a shunt resistor works well. They dissipate some heat, so dissipation and temperature coefficient can be an issue.
For large currents (>20A I guess) a CT is used to reduce the current and then put it through a shunt. The current in the shunt is low so dissipation is low.
There’s a range in the middle where things are open for debate :-)
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 3536
  • Country: gb
Re: mains power measurement (again)
« Reply #13 on: January 25, 2018, 11:50:45 pm »
On the CTs vs shunt resistors:
For small currents (< 5A I guess) a shunt resistor works well. They dissipate some heat, so dissipation and temperature coefficient can be an issue.
For large currents (>20A I guess) a CT is used to reduce the current and then put it through a shunt. The current in the shunt is low so dissipation is low.
There’s a range in the middle where things are open for debate :-)
For utility energy measurement, shunts are extensively used up to 200A. The popular energy measurement chips have reasonably high gain ADC inputs, so a 100 micro-ohm shunt for 200A, or a 200 micro-ohm shunt for 100A works well when directly connected to them. The energy loss with those resistances is pretty low. Most energy meter specs define an upper bound for insertion loss, and shunt based solutions easily meet those specs.
 
The following users thanked this post: Chris56000

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #14 on: January 26, 2018, 04:39:54 am »
For utility energy measurement, shunts are extensively used up to 200A. The popular energy measurement chips have reasonably high gain ADC inputs, so a 100 micro-ohm shunt for 200A, or a 200 micro-ohm shunt for 100A works well when directly connected to them. The energy loss with those resistances is pretty low. Most energy meter specs define an upper bound for insertion loss, and shunt based solutions easily meet those specs.

I only need to measure up to a US household circuit, so 20A. I'm using a 1 mOhm shunt (actually, two 2 mOhm in parallel) and did not notice any obvious warming even pulling 13A (1500W space heater) through it. Admittedly, I used the very unscientific measurement of putting my face very, very close to the shunts (without touching) to see if I could feel heat coming off. But at 20A, that's only 200 mW per resistor, and they were 2010 resistors rated for 1 W.

One appeal I can see for the CT at high currents is that you can put the CT on the conductors and not have to route the current through your board, with the attendant self-heating, potentially enormous traces, and signal interference with other traces. But in my case, that's not practical or desired, and so I think I'm going to stick with the shunt only.

 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #15 on: January 26, 2018, 04:50:31 am »
You could power it with an isolated high frequency inverter, or a small power transformer, or even with a series capacitor directly from the AC line if its current demands are low enough.

In the board pictured, I am powering the Pi with an external USB PSU, but the idea of a project that touches mains but is powered separately offends me, even though it's probably the cheapest way to go. But in my subsequent board, there will be a board-mount Meanwell AC/DC switcher than can give 5V @ 1A to power the Pi and the atmega, and I will either stick with the ISOW7841 to power the AFE, or do as you say and use a capacitive dropper and cheaper optoisolation. The AFE only needs about 6 mA max, so this seems very feasible.
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 3536
  • Country: gb
Re: mains power measurement (again)
« Reply #16 on: January 26, 2018, 04:51:45 am »
I only need to measure up to a US household circuit, so 20A. I'm using a 1 mOhm shunt (actually, two 2 mOhm in parallel) and did not notice any obvious warming even pulling 13A (1500W space heater) through it. Admittedly, I used the very unscientific measurement of putting my face very, very close to the shunts (without touching) to see if I could feel heat coming off. But at 20A, that's only 200 mW per resistor, and they were 2010 resistors rated for 1 W.
A 2 terminal 1 milli-ohm SMD shunt like that can work very well, as long as you are careful about the PCB layout. If you allow any copper to sit in the measured path, its 0.4%/C temperature coefficient can really hurt your accuracy over a reasonable temperature range. This http://www.analog.com/en/analog-dialogue/articles/optimize-high-current-sensing-accuracy.html has some pretty good info about getting reasonable accuracy from a 2 terminal shunt. Of course, 4 terminal shunts can do an even better job, but at a much higher price.
 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #17 on: February 17, 2018, 01:23:01 pm »
A 2 terminal 1 milli-ohm SMD shunt like that can work very well, as long as you are careful about the PCB layout. If you allow any copper to sit in the measured path, its 0.4%/C temperature coefficient can really hurt your accuracy over a reasonable temperature range. This http://www.analog.com/en/analog-dialogue/articles/optimize-high-current-sensing-accuracy.html has some pretty good info about getting reasonable accuracy from a 2 terminal shunt. Of course, 4 terminal shunts can do an even better job, but at a much higher price.

Wow, that link is interesting. I had no idea that the solder and copper leading to the pad such a short distance would be a significant fraction of the 1 mOhm resistance.

I've redesigned my sense resistor into a "faux" 4-wire (faux-wire) pads for the next iteration of the board. The picture is with and without copper so you can see the layout. This is the bottom edge of the board, the only place where any real current flows. The J's are for quick-connect male tabs, and F1 is a 5x20 fuse.
« Last Edit: February 17, 2018, 02:43:09 pm by djacobow »
 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #18 on: March 01, 2018, 04:25:39 am »
Short writeup of my meter project: https://toolsofourtools.org/archives/725
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 3536
  • Country: gb
Re: mains power measurement (again)
« Reply #19 on: March 01, 2018, 04:40:45 am »
Short writeup of my meter project: https://toolsofourtools.org/archives/725
In your writeup you don't seem to understand why an energy calibration is needed in addition to the voltage and current calibrations. Its because you need to adjust the phase between the voltage and current samples. Around unity power factor this has almost no effect, but at poor power factors even a small fraction of a degree of phase error starts to affect the accuracy of the power measurements. Typically, a calibration is done with a 60 degree phase shift between the voltage and current waveforms exciting the meter under test. The meter under test is then compared with a reference meter measuring the same voltage and current signals (typically through the energy pulses from the meters, rather than the power measurement), and the phase correction is tweaked to make them match.

Don't think you have a phase shift issue? Try looking at your design again.  :) I say this because a number of people will say "I'm using a shunt. There is no significant phase shift.". However, by the time the voltage and current signals reach the measurement chip there is normally enough phase shift to need tweaking.
 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #20 on: March 01, 2018, 04:49:40 am »
In your writeup you don't seem to understand why an energy calibration is needed in addition to the voltage and current calibrations. Its because you need to adjust the phase between the voltage and current samples. Around unity power factor this has almost no effect, but at poor power factors even a small fraction of a degree of phase error starts to affect the accuracy of the power measurements. Typically, a calibration is done with a 60 degree phase shift between the voltage and current waveforms exciting the meter under test. The meter under test is then compared with a reference meter measuring the same voltage and current signals (typically through the energy pulses from the meters, rather than the power measurement), and the phase correction is tweaked to make them match.

Don't think you have a phase shift issue? Try looking at your design again.  :) I say this because a number of people will say "I'm using a shunt. There is no significant phase shift.". However, by the time the voltage and current signals reach the measurement chip there is normally enough phase shift to need tweaking.

Yeah, you are right, i didn't understand it, and I am surprised to hear that there is a phase shift between the shunt and the ADC inputs. But I believe you.

Unfortunately, though I can scrounge up passable resistive loads, I don't know of a way to generate calibrated 60 degree or other shift. I mean, I could just make a little RC or LR network, but to get 60 degrees, we're talking a lot of L or C, particularly if the R is low enough that we're going well into the meter's range. That is, I'd get a much better calibration with a 3A current than at 30mA current.

Do you have any suggestions for cheap / clever ways to get the energy cal done without spending the big bucks on the proper test gear?
« Last Edit: March 01, 2018, 05:28:22 am by djacobow »
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 3536
  • Country: gb
Re: mains power measurement (again)
« Reply #21 on: March 01, 2018, 05:25:57 am »
In your writeup you don't seem to understand why an energy calibration is needed in addition to the voltage and current calibrations. Its because you need to adjust the phase between the voltage and current samples. Around unity power factor this has almost no effect, but at poor power factors even a small fraction of a degree of phase error starts to affect the accuracy of the power measurements. Typically, a calibration is done with a 60 degree phase shift between the voltage and current waveforms exciting the meter under test. The meter under test is then compared with a reference meter measuring the same voltage and current signals (typically through the energy pulses from the meters, rather than the power measurement), and the phase correction is tweaked to make them match.

Don't think you have a phase shift issue? Try looking at your design again.  :) I say this because a number of people will say "I'm using a shunt. There is no significant phase shift.". However, by the time the voltage and current signals reach the measurement chip there is normally enough phase shift to need tweaking.
Yeah, you are right, i didn't understand it, and I am surprised to hear that there is a phase shift between the shunt and the ADC inputs. But I believe you.

Unfortunately, though I can scrounge up passable resistive loads, I don't know of a way to generate calibrated 60 degree or other shift. I mean, I could just make a little RC or LC network, but to get 60 degrees, we're talking a lot of L or C, particularly if the R is low enough that we're going well into the meter's range. That is, I'd get a much better calibration with a 3A current than at 30mA current.

Do you have any suggestions for cheap / clever ways to get the energy cal done without spending the big bucks on the proper test gear?
Professionally these calibrations are done with expensive test benches that contain both a controllable signal source and a high accuracy reference meter. Professionally you don't want to be consuming many kilowatts as you test a meter. The test benches generate separate voltage and current signals, so you can avoid the consumption of power in a load. However, consuming substantial power for a short period is no problem as an experimenter. You just need a load with a horrible power factor, and an accurate meter to use as a reference.

A lot of the kill-a-watt type meters don't do proper power measurements, and give horrible results at poor power factors. However, you seem to have a genuine kill-a-watt. When I have checked a couple of those, the results have been pretty accurate, but I don't know if that is the case with all their models. So, connect your meter and the kill-a-watt to a load with a horrible power factor, and see how their readings compare. You have self-powered your isolated area with a cap drop supply, so its pulling a little power from the input. The kill--a-watt is also self powered. Whichever you put first in the chain is going to measure the self consumption of the second in the chain. This consumption may not be that high, but it can be enough to distort the measurement results when you are trying to achieve well below 1% error. You could try swapping their orders in the chain, as see the effect on the readings.

The Atmel/Microchip ATM90E26 is a nice device. It started life as an IDT product, and worked really well in customer testing. However, nobody seemed to sign up to use it in volume, and the sold the business was sold to Atmel. Atmel seemed to want it mostly to use the IP in their integrated metering ICs, but they still sell the standalone devices they inherited. Atmel has reduced the spec a bit (e.g. the temp coefficient), but it should still be a nice performer. With a good layout, and a good shunt, it can achieve 0.1% over a wide current range.

If you want to see the main source of those phase shift errors, look at the RC filters they put in front of the ADCs. How well do you think the filter in the voltage channel matches the one in the current channel, especially considering the very different source impedances?

 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #22 on: March 01, 2018, 05:47:46 am »
Professionally these calibrations are done with expensive test benches that contain both a controllable signal source and a high accuracy reference meter. Professionally you don't want to be consuming many kilowatts as you test a meter. The test benches generate separate voltage and current signals, so you can avoid the consumption of power in a load. However, consuming substantial power for a short period is no problem as an experimenter. You just need a load with a horrible power factor, and an accurate meter to use as a reference.

So, I can make a load with a terrible pf. I mean, I just looked on mouser and I can get a huge inductor in the 10-50mH range that can handle 5-10 amps for something like $50 (probably a ton for shipping, though). I can also get beefy power resistors. So I can easily make a load that would lag by 60 degrees and pull 5A or whatever. But I am still stuck with the fact that I don't have a way to calibrate the load. The resistor has some parasitic inductance, the inductor has parasitic resistance, etc. I guess I could take my load somewhere and have it characterized and use it as a reference standard.

A lot of the kill-a-watt type meters don't do proper power measurements, and give horrible results at poor power factors. However, you seem to have a genuine kill-a-watt. When I have checked a couple of those, the results have been pretty accurate, but I don't know if that is the case with all their models.

I have two or three of them and they do not read within a percent of each other. That's why I'm a little skeptical. And, lacking something I can use for "ground truth", I don't know which, if any to trust.

I am particularly interested in measuring reasonably low power devices, like USB chargers that are unloaded. These have horrid power factors, of course, and they are almost under the k-A-W's measurement threshold anyway. But I was thinking I could make an instance of my circuit with a much higher shunt value so that I could just scale it. (I tried the same surgery to a k-A-W, and it didn't go well. I'm not sure why.

So, connect your meter and the kill-a-watt to a load with a horrible power factor, and see how their readings compare. You have self-powered your isolated area with a cap drop supply, so its pulling a little power from the input. The kill--a-watt is also self powered. Whichever you put first in the chain is going to measure the self consumption of the second in the chain. This consumption may not be that high, but it can be enough to distort the measurement results when you are trying to achieve well below 1% error. You could try swapping their orders in the chain, as see the effect on the readings.

I actually have an older version of this circuit that has a separate power,  I think I can get around the consumption of my own device.

The Atmel/Microchip ATM90E26 is a nice device. It started life as an IDT product, and worked really well in customer testing. However, nobody seemed to sign up to use it in volume, and the sold the business was sold to Atmel. Atmel seemed to want it mostly to use the IP in their integrated metering ICs, but they still sell the standalone devices they inherited. Atmel has reduced the spec a bit (e.g. the temp coefficient), but it should still be a nice performer. With a good layout, and a good shunt, it can achieve 0.1% over a wide current range.

Well, I like to think I'm getting close! But the cal is going to be thorny, for sure.

If you want to see the main source of those phase shift errors, look at the RC filters they put in front of the ADCs. How well do you think the filter in the voltage channel matches the one in the current channel, especially considering the very different source impedances?

Well, I don't know the impedances of the ADC inputs, but I guess I figured those networks were for noise and would be practically invisible at 60 Hz. The one on the shunt is 100 ohm / 330nF and the one on the voltage input is 1k / 33n. I never simulated it because I just figured the ref designers knew what they were doing. Probably never a good idea.
 

Offline jbb

  • Frequent Contributor
  • **
  • Posts: 476
  • Country: nz
Re: mains power measurement (again)
« Reply #23 on: March 01, 2018, 06:15:18 am »
In short: Get thee to a calibration lab.

In medium: your problem is you don't have any 'good' references around the place.  Even a high accuracy true RMS multimeter won't do it, because the phase relationship - and especially distortion - are critical for active power measurement.

So you should reach out to calibration labs in your area.  If you can arrange a physical visit, great.  If not, you'll need to prepare test samples (more than one!!!) and calibration instructions.  Ask if they can help with a 'Debug' calibration for early product development.

Before going to a lab, you should do your own rough 'calibration' at home to make sure that the software is stable and all your safety properties look OK (e.g. suitable creepage / clearance, correct isolator chips, boards are clean and tidy, boards are mounted in a box with suitable connections e.g. 4mm shrouded banana jacks).

Once you're at the lab, time is money.  Therefore everything should work nicely from the get go. Bring your own laptop where you know that the comms cable works right. Bring all the cables. Bring a camera and notebook.

Finally, I would recommend against any trimpots for calibration.  The cal lab would likely have to stop the test, turn off the calibrator output, fiddle with the pot, and restart the test.  This can slow things down a lot...

Alternatively, you could look at hiring (or buying second hand) an AC calibrator.
 

Offline djacobow

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: us
  • takin' it apart since the 70's
Re: mains power measurement (again)
« Reply #24 on: March 01, 2018, 06:18:33 am »
Based on your advice, Coppice, I just tried quick-n-dirty simulating the input filters based on the input impedances in the ATM90E26 datasheet (400k single-ended for the voltage inputs and 1k single-ended for the shunt input). Using a pretty significantly lagging load, I didn't really see much of a phase mismatch between the current in the shunt and the filtered voltage difference around it, nor did I see it between the voltage at the load and the voltage difference at the voltage inputs.

I could have set this up wrong, of course. I'm attaching the shot of the circuit and plots.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf