how to measure the direction of a.c. power flow - Page 1
Forum section: electronics / projects

author: CodeDog
author_rank: Contributor
timestamp: January 18, 2017, 03:54:44 am
content: Here's the idea: unobtrusively measure the direction and intensity of power flowing along an a.c. line, and by unobtrusively I mean without a physical connection (e.g. clamp meter, Rogowski coils, ...), and the amount of power is not so important, just a relative value would be sufficient.Why? ... Like a lot of others, I have solar panels on the roof. I also have a few high energy users such as a pool pump, and an airconditioner. Wouldn't it be great if I could immediately detect when I'm exporting power and flip on the pool pump? Or the aircon? And if it gets cloudy and I'm no longer exporting power, to turn off the pump?If I could determine whether energy is flowing into my house or out of my house (on the mains active line) that would be fantastic. And if I knew how much (or even relatively how much) that would be even better. A centre-zero analog meter for a display would be sufficient.But how to measure the direction in which energy is moving in an a.c. line? Phase angle doesn't do it. Some sort of directional coupler maybe?One alternative would be to measure the power output of the solar array and the power consumption of the house, and calculate the difference - which would be either the power I am importing or the power being exported - depending on which is the larger of the 2 measured values. But this is not simple as I don't have easy access to the circuits feeding the house.Another alternative would be to watch the meters in the meterbox and work out manually whether I'm importing or exporting - but this is time-consuming and doesn't provide an instantaneous indication of the situation.Is anyone aware of a simple means to measure the direction in which energy is travelling on the a.c. feed to the house?I sense a market opportunity here for a clever solution, if there isn't already something out there.cheers,Mark

author: viperidae
author_rank: Frequent Contributor
timestamp: January 18, 2017, 05:32:15 am
content: I'm pretty sure it works if you measure the current direction compared to the voltage.Emoncms is an open source product that can do it

author: CodeDog
author_rank: Contributor
timestamp: January 18, 2017, 06:08:39 am
content: huh?with ac there is no such thing as current direction is there? ... the current flows back and forth, 50 or 60 times a seconddepending on your location ... hence "alternating" current ... all day long the electrons just oscillate and barely movemuch at all as far as I understand ... so there is no current direction.But there is a current. (a movement of electrons). Just not in one direction only.And although the current is not in one direction, energy DOES get transferred in one direction ... from the source to the load.A.C. is weird.the old-fashioned spinning disk meters could do this job ... if power was exported, the disk ran backwardsis there an electronic equivalent that does not require connection to the feed cable?I totally don't understand what you mean by "measuring current direction compared to voltage". Sorry.cheers,

author: Brumby
author_rank: Unknown
timestamp: January 18, 2017, 06:17:11 am
content: Quote from: CodeDog on January 18, 2017, 06:08:39 amSeems there is a voltage/current relationship exploited in those old electromechanical meters....

author: Seekonk
author_rank: Super Contributor
timestamp: January 18, 2017, 07:52:09 am
content: The concept of scheduling and prioritizing loads is the future of energy, grid or solar. With smart meters they will in the future start charging more for peak demand periods. The utility grid prefers to have your panels facing west to get that extra in late afternoon when they need it. Since a meter can only look at volts and amps, it has to be looking at phase angle. That would imply that at some phase condition the meter would just stop. Too much to think about at 3am.

author: Jeroen3
author_rank: Super Contributor
timestamp: January 18, 2017, 08:12:33 am
content: You do this with the phase angle. And to know this you both need to know the current and the voltage.Theoretically, you could use a capacative voltage meter, and a split core transformer core. But it would be very inaccurate since mains isn't a nice sine wave anymore. Thanks pfc.Here are some fancy images.Basically, the polarity (or pi phase angle) of the current determines the direction of the power. This is why you must always have your split core put on the right way. Otherwise the power is wrong.https://openenergymonitor.org/emon/buildingblocks/ac-power-introduction

author: Alex Nikitin
author_rank: Super Contributor
timestamp: January 18, 2017, 09:16:31 am
content: A clamp current sensor and a synchronous demodulator clocked by the AC line frequency. The output polarity would depend on the phase of the current in reference to the voltage and will show the direction of the energy flow.CheersAlex

author: VK5RC
author_rank: Unknown
timestamp: January 18, 2017, 10:29:29 am
content: I don't know much about mains but the classic RF solution is a directional coupler, it relies on the phase difference between the capacitively coupled and inductively coupled signal in the coupled line, some guys in the solder smoke podcast found a copy of one of the early Navy tech papers and retyped it (I have noted a few typos)FYI.http://soldersmoke.com/SWR%20N8ERF.pdf

author: dmills
author_rank: Super Contributor
timestamp: January 18, 2017, 12:18:39 pm
content: Which is actually fairly easy, a clamp on current transformer with a suitable burden resistor and a voltage sampler, multiply the ac voltage and current samples together, lowpass and drive a centre zero meter.You could probably do this with a diode ring mixer made with small mains transformers with the 'LO' port driven by the mains voltage and the 'RF' port being the current transformer, the IF port would then drive a centre zero meter scaled in kW.I make it one small mains transformer, 4 diodes, one current transformer, four resistors and a centre zero meter movement, maybe a cap to avoid the needle shaking (And you can probably do away with the mains transformer but I would be cautious about that).There are actually devices available that pretty much do this, the usual target being the hot water system (Switch on the heater such that net power is zero), our hard of thinking government set things up so that solar is paid a subsidy even if YOU use all the power!73 Dan.

author: Circlotron
author_rank: Super Contributor
timestamp: January 18, 2017, 12:21:59 pm
content: What about monitoring the winky LED on the smart meter? If you are exporting power it stops flashing.

author: QuantumLogic
author_rank: Contributor
timestamp: January 19, 2017, 09:48:11 pm
content: You will also need to put in some sort of delay circuitry to prevent switching loads on and off with each passing cloud. Otherwise you'll burn up some stuff doing that too much (AC compressor, especially).

author: rstofer
author_rank: Super Contributor
timestamp: January 19, 2017, 11:49:59 pm
content: Aren't you just billed at the end of the month by the utility? Does it even matter when you export? It may matter if you are on a time-of-use schedule but, if that's the case, you would never run heavy loads during that time of day. Presumably, the utility also pays more for your exports during on-peak periods but that isn't universally true.When I had solar, Pacific Gas and Electric would run an annual account and we 'settled up' at the end of the year. I made no monthly payment for kWh. Whatever I generated they didn't sell so the only kWh they saw as demand was what they actually delivered. I wasn't billed for time-of-use but there was a tier scheme. My 8 kW array was so large that at the end of the year we were within about $50 of paying nothing to PG&E other than the monthly meter charge.But there's a gotcha in the scheme. Customers are not allowed to be net generators. I paid the solar company $0.15/kWh (Power Purchase Agreement) but if I over-generated when settle-up came along I would be reimbursed only $0.04/kWh by PG&E. It didn't pay to over-generate.In any event, the new Smart Meters run in both directions and it is based on phase angle. To sell power to the grid, you have to try and lead the voltage. You are a buyer if your generator can't lead. This phase angle lead is very small.http://www.gosolarcalifornia.ca.gov/solar_basics/net_metering.php

author: CodeDog
author_rank: Contributor
timestamp: January 20, 2017, 12:11:43 am
content: here in Qld, I only get 8c per kWh exported, so there's not much benefit in exporting at allcost to import is 28c, making it beneficial to use the power I generate rather than export itearly adopters still get high export rates (44c i think) and I know several people whoactually get a cheque each quarter because the value of their exports exceeds the valueof their importsyes, there'd need to be some sort of hysteresis in the algorithm to flip the loads on or off,so as to avoid turning things on and off as each cloud passes by

author: Someone
author_rank: Super Contributor
timestamp: January 20, 2017, 01:01:01 am
content: Quote from: CodeDog on January 18, 2017, 03:54:44 amGood thinking to make the best investment from your solar system, sadly the networks are making it hard to get this capability as they won't get any profit from it. If you have a smart meter you can get "in home displays" that have computer interfaces to extract the information with a usable latency, otherwise you'll probably need to add some current clamps to the meter box unless we can get some very clever solution from the crowd here.Quote from: CodeDog on January 18, 2017, 03:54:44 amYes

author: reubenT
author_rank: Newbie
timestamp: May 15, 2019, 08:02:26 pm
content: Quote from: dmills on January 18, 2017, 12:18:39 pmThis is what I need right now. Been hunting for a practical circuit with component values designated, to make one for use in metering in/out for motor/generator experiments. The theory is all good, but I'm not an electronics engineer, just an old do it myself experimenter with all kinds of junk around to play with. Anyone have a lead on a circuit diagram?

author: soldar
author_rank: Super Contributor
timestamp: May 15, 2019, 09:26:05 pm
content: Quote from: CodeDog on January 18, 2017, 03:54:44 amHuh? Phase angle is exactly what counts. If the current is exactly in phase with the voltage then power is flowing in the direction of the current and there is only real power. If there is some phase difference then you have reactive power flowing back and forth.Measuring instant voltage and current is trivial and it should not be difficult to design a simple circuit (maybe with op amps) which would continuously multiply both magnitudes and it would read positive when power goes in one direction and negative when it goes in the other.

author: David Hess
author_rank: Super Contributor
timestamp: May 16, 2019, 02:47:22 am
content: To do it non-intrusively, I would use a current transformer and electrostatically couple to the lines to measure the voltage. Between the two, the phase can be found to determine direction. I suspect the simple way would be to only detect the polarity electrostatically and use that to multiply the current by 1 or -1 so a positive or negative current is returned indicating direction and magnitude.Why not get a Kill-O-Watt or whatever and permanently wire it into the circuit?

author: Circlotron
author_rank: Super Contributor
timestamp: May 16, 2019, 05:34:40 am
content: Assuming a unity PF load, if at any moment your house is pulling the instantaneous supply voltagedown(incoming power) then we would say the current is in phase with the voltage. If things change and then your house is pulling the instantaneous voltageup(outgoing power) then the current would appear to be 180 deg out of phase with the voltage. The current trace would invert on your scope and the voltage trace would stay the same. Think in terms of DC and it becomes clear. That's how I see it.

author: soldar
author_rank: Super Contributor
timestamp: May 16, 2019, 08:57:32 am
content: Quote from: David Hess on May 16, 2019, 02:47:22 amI cannot imagine any good reason to sense voltage electrostatically. I mean, you have a hundred devices connected in your home and you do not want to connect a volt meter? Why?Another issue is that you cannot assume current and voltage will be in phase. Not at all. Homes have a lot of reactive loads.Will a kill-o-watt indicate negative power? I have never tested that. It would be interesting to connect the load to the prongs and connect the power input to the receptacle and see what happens.

author: richard.cs
author_rank: Super Contributor
timestamp: May 16, 2019, 11:56:23 am
content: I have built a device which measures net power at the mains input and if there is solar power exported servos it to zero by switching in and out loads. I have in fact been meaning to put a write-up in this forum for the last year or more but it's just not happened yet.In my case the power measurement is current via a small current transformer, voltage via a resistive divider and a direct analogue multiplication to get a voltage corresponding to power. This is low-pass filtered (as it has a strong 100 Hz component) to get a real time power measurement for logging. To control the loads this signal is integrated to get energy and the controller switches loads in and out based on priority to keep the energy centred in a 3600 Joule window which corresponds to the (intentional) dead band in the electricity meter. The loads pulse on and off at a frequency set by their size the the solar generation with a few hundred Joules being shunted into and out of the grid and zero new usage.This is not the cheapest measurement approach, but it is simple and works well. It has a bandwidth of a few kHz until after the multiplication so odd current and voltage waveforms don't affect it at all. The multiplier output always reflects the instantaneous power and the integrator the total energy used.

author: soldar
author_rank: Super Contributor
timestamp: May 16, 2019, 01:05:15 pm
content: That sounds very interesting and I would be interested if you can tell us more.I have often thought about load management but it seems complicated because each home has very different loads and because of the complication of switching remote loads from a central location.

author: NorthGuy
author_rank: Super Contributor
timestamp: May 16, 2019, 01:08:19 pm
content: Quote from: richard.cs on May 16, 2019, 11:56:23 amI don't think the analog multiplication is a good idea. All current transformers produce a small phase shift. I tried to use very best current transformers, but yet there was considerable phase shift (if I remember correctly around 40 us). Typically, the phase shift doesn't produce big errors, but if the load PF is around 0.6, the error becomes dramatic. Therefore, an MCU which can calibrate the phase shift and account for it, will produce much more accurate results.

author: richard.cs
author_rank: Super Contributor
timestamp: May 16, 2019, 01:31:23 pm
content: Well this is what I wrote a while back:I built this a while ago now (about a year ago, and installed it about 3 months ago) [now more like 2 years ago] but have only just gotten around to writing it up. Essentially it is a 4-channel load controller for optimising the use of domestic grid-tied solar. The four loads can be assigned different priorities and are modulated to servo the net exported energy to zero so all generated electricity is used internally. It takes advantage of the 1 Watt-hour (3600 Joule) "dead spot" that electricity meters (in the UK at least) have by design by tracking a "window" of 3600 Joules and modulating the loads on and off when they reach the edges of the window. In fact there are four priorities to which the loads can be assigned and each has 1/4 of the window so any one load actually oscillates around 900 Joules. On a mechanical meter this rocks the disc back and forth by less than one turn, on an electronic meter it does the equivalent with an internal buffer, in both cases a few hundred joules is repeatedly "borrowed" from the grid (as the loads are generally greater than the generation) and then returned a short while later.I suspect most people would probably do this in software, but I thought it interesting to do it all analogue. A voltage signal from a simple resistive divider is buffered and used to feed one input of an analogue multiplier, a current transformer generates a voltage across a burden resistor which is then amplified and fed to the other input. The multiplier outputs a signed voltage proportional to power, pretty much independent of how ugly the current waveform is, and this is fed to an integrator with a low-leakage capacitor. This integrator tracks the window and a bank of four comparators switches switches the loads. Each comparator has a little less than 1/4 of the window in hysteresis, and one of four thresholds set by selecting load priority. The loads are switched by large triacs which are triggered by smaller opto-triacs.There are a few extra features to the circuit, it has an overheat detection which shuts down all of the loads, and a remote override which allows a load to be forced on even if it would result in net power import. This is actually the main reason for the overheat detection as it becomes possible to turn on all loads (a total of up to 60 A) simultaneously - something that wouldn't happen normally as max solar generation is only 16 A per phase. The override circuit has its own isolated power supply so that it can use external switch contacts, but a powered source is possible by moving some jumper around. LEDs are driven to indicate the status of the loads and also to indicate if the integrator has run into the rails implying net import/export.Power supplies are kept pretty simple and transformer based, with long-life, high temperature electrolytics and low ripple currents to give maximum service life. Four supplies are generated, an isolated 5 V for the remote override and a +12 V, -12 V and +5 V for the main circuit which is neutral-referenced. There are a couple of expansion connectors with the power supplies and the various voltage, current, power and energy signal on to allow a future digital board that does monitoring and/or augments/replaces some of the control functionality. The main power channel measures net import/export, there is an auxiliary channel that measures solar generation - it's not needed at all for the controller but provides some extra signals to the expansion connectors.As this went straight to PCB without prototyping there are a few bugs which have resulted in hand-modifications but nothing major. Mainly this relates to a mistake regarding comparator common-mode input range, which was corrected by adding a low-power zener-regulated supply at ~16 V. The whole thing has been built into a metal box with four 16 A MCBs for the loads and front-panel switching for the priorities. So far only two of the load channels have been used but more will be added.In operation the highest priority load is turned on first, and then if solar output is more than that load additional loads are switched in, with the lowest priority load being switched on and off to maintain the zero average input power. In practise most of the time the generation is smaller than the loads so the highest priority load is switched on and off until it stops drawing power (e.g. cutoff by its internal thermostat) and then that is left on and the next load switched in. If some uncontrolled load is added then the controller acts in the same way as a reduction in generation, shedding the controlled loads to try and maintain zero import.Schematics attached, not including the hand mods. Also a photo of the complete assembly.Quote from: NorthGuy on May 16, 2019, 01:08:19 pmI make no claim that this is the best solution, I'm just describing what I used. I didn't see significant errors from my current transformers but nor did I look especially hard, accuracy was plenty good enough for the application. I am familiar with the digital approach to this, but at the time I fancied doing something different, if done for work it would likely have been a totally different design. Digital also has its own pitfalls (non-simultaneous ADC sampling on most common micro controllers being one). The design also throws all the signals including before multiplication onto an expansion header with the thinking that some future board digital board could either take over control allowing more sophisticated features, or just provide monitoring. That has now been designed but I've not built it nor written any software.Overall design aim was for simple and robust, which seems to have been achieved. It's been in continuous use for about 2 years, though still on only two of the four channels. I have a few spare boards knocking around too.

author: richard.cs
author_rank: Super Contributor
timestamp: May 16, 2019, 02:03:43 pm
content: Quote from: 3roomlab on May 16, 2019, 01:15:00 pmI don't find your schematic very clear but yes that is what I would expect to see. In one direction the current and the voltage are in phase and in the other they are 180 degrees out of phase. With real loads they could also have other phase differences (which correspond to reactive power). In LTSPICE you can multiply waveforms by right-clicking on the name in the waveform viewer and editing - if you multiply your voltage and current quantity there it will give you power.

author: David Hess
author_rank: Super Contributor
timestamp: May 16, 2019, 03:05:50 pm
content: Quote from: soldar on May 16, 2019, 08:57:32 amCodeDog asked for a unobtrusively measurement. I took that to mean galvanically isolated and without connecting to any wires.QuoteSo what? The reactive power component will cancel out in the measurement leaving the real power component. The accuracy will be poor without an RMS measurement but it will be close enough for most purposes.QuoteI am not sure either. Next time I visit Home Depot, I will get the parts to make a set of cords to hook one up backwards.Quote from: NorthGuy on May 16, 2019, 01:08:19 pmIf this is a problem, then creating the same phase shift in the voltage measurement before multiplication would not be difficult even in the analog domain.

author: soldar
author_rank: Super Contributor
timestamp: May 16, 2019, 06:45:52 pm
content: I did a test. I took an AC current of about 2 A and measured it directly on the scope on one channel and sensing through a current transformer on the other and the original appears 0.7 mS later on the scope. The CT leads by that amount of time which is about 1/25 of a cycle. Not huge but significant enough to degrade true measurements.It was a quick and dirty test. I did not do other measurements to see if the phase difference changed significantly with the current. If it is pretty constant then it should not be difficult to correct it either with a capacitor at the CT or maybe just correct the voltage phase so it is in phase with the current reading. Should not be difficult.But if you want true power reading you need to do it because otherwise You can have a purely resistive load and it looks like it is somewhat reactive and returning some energy when it is not.The advantage of a CT is the isolation but if you want to have really good phase reference a shunt is much better.As a side note: I have discovered that the second channel of my 'scope is defective and needs repair. It has a big DC offset upwards and I cannot get 0V into the screen. Oh well. That'll be a different thread.

author: Circlotron
author_rank: Super Contributor
timestamp: May 17, 2019, 04:12:25 am
content: Was that CT phase shift test using the proper burden resistor? I expect that too high a resistance will give phase shift problems.

author: coppice
author_rank: Super Contributor
timestamp: May 17, 2019, 07:22:36 am
content: Quote from: soldar on May 16, 2019, 06:45:52 pmThe delay through a CT, and its character, varies enormously with the core type. For some cores its approximately a time delay. For other cores is approximately a phase delay. 0.7ms is a huge delay for a CT. Is it made by VAC? They have some models with huge delays. Most CTs give a delay far smaller, and some give a delay so small that can be ignored for most purposes. For example, most large multiplier CTs are designed to introduce such a small delay that they have little effect on the calibration of the measurement unit whose range they are multiplying for.A serious problem using CTs with a big delay is that the delay will vary a lot with frequency. Compensating for the delay at the fundamental may be straight forward, but getting the delay right for all the harmonics can be a nightmare.

author: soldar
author_rank: Super Contributor
timestamp: May 17, 2019, 08:54:11 am
content: I tested with a lower resistor and the phase difference diminished just a bit. I could not measure it with precision because I am having problems with my scope.Still, it should not be difficult to correct the voltage phase a bit so that it is in line with the current phase.Frequency is not really a concern because it is for mains.The purpose is not to precisely measure power as a meter might do but to determine in which direction power is flowing.

author: David Hess
author_rank: Super Contributor
timestamp: May 28, 2019, 01:45:40 am
content: Quote from: David Hess on May 16, 2019, 03:05:50 pmI figured this would be a good simple experiment for this Memorial Day weekend.I made a pair of reversed extension cords and hooked the Kill-O-Watt that I have up backwards. It still read positive power flow. Bummer.

author: soldar
author_rank: Super Contributor
timestamp: May 28, 2019, 10:11:08 am
content: With strictly resistive loads it should not be difficult to do a rough indication by taking a semicycle and seeing in what direction the current flows during that time.The problem starts when you have reactive loads. Now you can have energy flowing back and forth so you need to do a total measurement and see in what direction is the net flow. Not straightforward or simple.I wonder if the old electromechanical KWH energy meters would turn backwards. If I remember correctly they probably did but had a ratchet to prevent it.In that case an old meter could be used to detect the direction of energy flow.I have a crate full of them. Maybe One day I can do some tests.

author: richard.cs
author_rank: Super Contributor
timestamp: May 28, 2019, 10:16:33 am
content: The mechanical meters without ratchets turn backwards, the ones with usually rotate backwards up to one turn of the disc and then stop. Some types have flags that drop to indicate that this has happened.

author: soldar
author_rank: Super Contributor
timestamp: May 29, 2019, 03:29:17 pm
content: Come to think about it, if volume is no problem, a quick and easy way of detecting power flowing out would be to have some switch in place of the ratchet so that when the disk is trying to turn back it is activating a switch. That would be very simple to do using an old meter.

author: rgody
author_rank: Newbie
timestamp: September 10, 2019, 02:14:41 am
content: An easy way is to use a known load ( for example "test load" of 220V 220ohms) in conjunction with an ammeter measuring total current to the house .The test load should be connected for a few seconds only to "see" the ammeter.If you connect test load and the current in ammeter arise, your house is in "load" mode. If you connect the test load and current decrease, your house is a source.If you know whether your house is a load or a source, then you can calculate the power just measuring current with no test load connected.I this idea you just need a contactor, a known resistance, a TC and a simple circuit that just need the current signal to calculate power as a source or load.