### Two Emontx’s for simultaneous V & I measurement

I am interested to understand the feasibility of using two Emontx’s to measure voltage and current simultaneously and hopefully also increase the sampling frequency.

The idea I am sure is not new and has probably been discussed before, but I could not find anything here, although seeing Martin Robert’s Full-fat 3-phase monitor certainly inspired this post.

Martin’s monitor shows that in principle, it can be done; however, I’d be interested in any thoughts on the likely maximum sampling frequency and will the communication between emontx’s be a bottleneck?

Would an interrupt approach work and perhaps could it even correct for the relative phase error of the sensors?

### Re: Two Emontx’s for simultaneous V & I measurement

If I'm reading you correctly, you will have one emonTx as the master reading voltage (say), and a second one reading current. You want to synchronise the two to read at the same instant?

The delay between consecutive readings (V & I) using both the standard library and interrupts is only one third of the phase shift problem. The other two thirds are phase shifts within the transducers, and unfortunately those vary with voltage and current respectively. Eliminating the delay won't necessarily improve things, because with a suitable combination of voltage and current, the difference can come very close to the time delay between readings, and then you'd need no correction at all.
Ideally, you should have a 2-dimensional lookup table and apply a correction based on the expected combined phase error at the voltage and current that you're measuring.

Fortunately, phase errors make little difference to the measurements at 'normal' power factors, and only become critical as the power factor gets small with highly reactive loads.

### Re: Two Emontx’s for simultaneous V & I measurement

Robert, Yes two Emontx's one measuring voltage and one measuring current, synchronised either measuring at the same time or timed to correct for the relative phase shift in the sensors.

The objective would be two fold; firstly and hopefully to double sample frequency; secondly have better control of the timing of V & I samples.  I understand your points about phase shifts within the transducers and my thinking was that as you say with a look up table or function suitable timing could be determined such that V & I pairs are corrected for relative transducer phase shift.

I'm really only interested in a more accurate real power / energy measurement here and although I haven't quantified it, sampling V and I at different points in time will lead to an error.

I've built a breadboard version of the AVR465 variable gain current front end connected with an emontx to measure voltage.  This works well and I was about to build this as a strip board circuit, when it occurred to me to go a step further and add another processor.

Before making too big a step I thought I'd investigate using two connected Emontx's one measuring voltage and the other with conventional current front end to prove the concept.

edit I'm not using any of the OEM library calculation methods, but am using my own continuous integration method to calculate energy directly.

### Re: Two Emontx’s for simultaneous V & I measurement

Thanks for clarifying. (I mentioned the library purely as a common point of reference).

By far the biggest source of errors we see is digital noise coming from the processor itself, which of course makes little difference at full power but unfortunately many people expect 5% accuracy with one or two counts of current at the input! The variable gain front end should help quite a lot there, provided the noise gets in where I think, which is via AVref.

Before going too far down your path, I'd sit down and work out just how much phase error you can tolerate, given the power factor of your load - under worst case conditions, obviously.

You do stand to double the number of samples, up to about 100 per cycle, which should capture the 49th harmonic. I think there might not be much power up there. (I have churned out a fair bit of power at the 23rd and 25th with a 12/24 pulse thyristor drive, but there aren't many of those around now.) I believe your meter only needs to include up to the 20th in its measurements.

I'll be interested to see how this turns out, especially if you are able do a parallel comparison between your rig and a standard emonTx (using Martin's code to give continuous energy measurement).

### Re: Two Emontx’s for simultaneous V & I measurement

By far the biggest source of errors we see is digital noise coming from the processor itself

I made the assumption the noise is a constant offset and corrected for it with my calibration method.  Instead of using just a coefficient for calibration I have y=ax+b type calibration.  This enables a zero reading when there is no load and also improves the accuracy throughout the range.

I obtained the calibration coefficient and offset using linear regression, first measuring current for a number of loads, then doing the same for power.  The fit is much better using a y=ax+b function than for the emonlib method of y=ax .

It's a fudge, but seems to improve accuracy and can remove the annoying power reading when there is none.  Is there a reason why this approach has not been used in the emonlib?

I note the AVR465 just removes values below a certain level, but I don't agree with this approach.

### Re: Two Emontx’s for simultaneous V & I measurement

I note the AVR465 just removes values below a certain level, but I don't agree with this approach.

I doubt that has - primarily - much to do with noise (though it sweeps it under the carpet). I've not checked the numbers, but wouldn't it be emulating the friction (anti-creep) found in a mechanical meter?

I've no idea why your algorithm hasn't been used. If the noise is relatively constant, then it's a valid approximation for power and energy. It won't work in detail because the noise 'current' appears to have a variable phase so power and apparent power are affected differently.

### Re: Two Emontx’s for simultaneous V & I measurement

I think the main problem with what I'm doing is that it is a correction after the High Pass Filter.  The HPF should in theory remove any DC offset including the noise if it were indeed a constant.  However we are dealing with a 10 bit ADC and at low current levels there inevitably is an offset. So my calibration effectively removes this offset.  At this point you could argue its not noise but a lack of resolution.

It seems to achieve more accurate results for real power and apparent power; therefore PF as well :-)

I don't really understand what you mean by 'It won't work in detail because the noise 'current' appears to have a variable phase so power and apparent power are affected differently.'

To clarify I'm only calibrating current and voltage with a coefficient and an offset.  However since I can only apply different loads thus varying the current, I calibrate that directly then calibrate power indirectly with a voltage coefficient and an offset.

edit: I do appreciate as I said it is a fudge, and ideally noise or errors should be removed at source or as close as possible.  But I have not yet found a better way and can't see why any subsequent calculation should be incorrect; its just a more refined calibration.

### Re: Two Emontx’s for simultaneous V & I measurement

We're talking about different things then. I really meant digital noise - high frequency signals emanating from the digital part of the processor, and as such it goes straight through the H.P. filter. So when it gets rectified by the rms calculation, it appears as a randomly varying current that is not related to the voltage input, hence (and this is where it gets difficult to explain) it appears to have an indeterminate and varying phase angle that depends on where the higher random samples line up against the voltage wave. But when you multiply the current samples by the voltage samples to get power, the rectification effect disappears.

Now we pick up your argument and what I think you're saying that after you have calculated energy over the sample period and turned it into power, the averaging process has turned the noise into a sensibly constant standing power that you can legitimately regard as an offset. I'm not disagreeing there. What I was saying is the apparent noise power is significantly greater than the real noise power ('apparent' and 'real' in the sense of the phasor diagram) because the noise current is not correlated with the voltage. Therefore you need different rules for power, apparent power and current.

And not forgetting that where the midpoint bias sits in relation to ADC steps can be significant.