Phase Calibration EmonTxV3CM

I’m new to the community and I’m in the process of calibrating CT sensors (SCT006) with my emonTx running the continuous monitoring firmware. I searched through previous posts and I wasn’t able to find anyone else with the phase cal problem I’m experiencing and that lead me to believe that I’m doing something wrong. So I’m posting here to seek out some help.

I am operating in the US in case it matters and the hardware has been configured accordingly. I’m able to calibrate the amplitudes accurately against a Keysight DVM and clamp on current meters. The phase calibration, however, is problematic because I can’t seem to fine tune the phase cal term to achieve power factor = 1. In my situation, the greatest pf I can achieve is about 0.85 tuning in 1 deg steps of the phase cal parameter. The calibration procedure (Learn | OpenEnergyMonitor) indicates this parameter should be in the range 0 to 2. But in my case, monitoring power consumption of my 1500W electric hot water kettle, the pf on power up is about 0.77 which would indicate a phase offset of acosd(0.77) ~40 degs; far outside the specified range. Tuning the phase cal parameter to 40 degs yields the optimal pf of 0.85 and thats the best I can do.

On the subject of the large phase cal correction, I considered MAYBE my water kettle has a reactive impedance component that I’m overlooking so I also checked with a counter top electric oven and observed a similar phase behavior - I just can’t achieve pf=1.

Can anyone offer some insight as to what may be happening here?


You should be following the emonLibCM calibration, not that for emonLib (the Discrete Sample version) which is what that ‘Learn’ article describes. Unfortunately, I don’t have easy access to that documentation to be able to change it. If you download the emonLibCM zip file complete, you’ll find the full documentation in there. I can’t give you typical values, because (a) I don’t have a USA adapter and (b) I run on 50 Hz mains, and the phase errors of the transformers will be different.

Thanks for your response and pointing me to the EMonlibCM User Guide. It did not find that it provides a procedure but it does reference the functions utilized to calibrate the sensors. Using that information, I manually edited the parameters in the EmonLibCM max example sketch to calibrate against my meters again using my “calibrated” hot water kettle to fine tune the pf. Once again, I was only able to achieve a maximum pf of 0.85 which is consistent with the serial port interactive method I applied using the emonTxV3CM sketch. It seems like this is somehow a limitation of the CM technique (maybe in the interpolant?) - but I’m far from certain. Do you have any insight?

Thanks again,

That’s hardly surprising as you’re adjusting the same quantity at the end of the day. But the advisory limitation of 1.0 - 2.0 doesn’t apply. I pointed you towards the correct documentation because that gives details specific to the CM library: the number you’re inputting is in degrees, not a proportion of sample spacing. The section of interest is on page 3:

Phase error compensation: This is the phase lead of the voltage transformer minus the
phase lead of the current transformer, in degrees. (It will be negative if the c.t. leads the
v.t.). The defaults and the approximate values for the combination of Ideal/TDC UK
adapter & YHDC SCT-013-000 on a 240 V 50 Hz supply for the emonTx channels 1-3 is
4.2°, and for channel 4 it is 1.0° at maximum current. (Hint: use steps of 0.2° or larger if
setting by trial & error.)

What value range are you trying, and does the p.f. reach a maximum of 0.85 and fall away each side? What value gives you 0.85? How many c.t’s are you using?

I think your problem is going to be that you have a significantly different phase shift in one or both of your transformers. As I mentioned, I don’t have access to the USA a.c. adapter and a 60 Hz supply. Using the UK adapter, the YHDC SCT-013-000 and 50 Hz, 0.995 is achievable over a limited voltage and current range (because of course the phase errors of the transformers are dependent upon the amplitude of the quantity being measured).

I take it you’ve set the frequency to 60 Hz, as that clearly influences the timing.

If that’s correct, then you must have a pair of transformers (c.t. & v.t.) that have a difference in phase errors - it’s not the absolute phase error of either that matters, it’s the difference between them - that’s significantly different to our “standard” devices at 50 Hz, and we’d need to look at storing either the voltage or the current sample to shift the range that “phaseCal” gives you.

Thanks again for your quick response. I went backthrough all the documentation I could find on the SCT-006 and it appears that I overlooked your recommendation to NOT use the sct-006 sensor with the CT4 input on the emonTx for loads over 6A which is unfortunately what I was doing. It appears that my water kettle’s load (1500W @ ~120VAC) was driving the sensor into saturation on this input. After I realized this, I moved the same sensor over to CT1 and I’m able to achieve pf = 1 with the water kettle. I also found a lower power hair dryer kicking around and with 450 and 700 W settings and I’m able to tune the pf of the CT4 input with the SCT-006 to achieve unity with this load. Sorry for not pointing out I was using that input from the get go - probably would have short-circuited all the previous conversations.

So I’m up and running now though it looks like the small negative reactive residual of one CT (~ -1 to -3 VAR) in the payloadTX struct is being interpreted as an unsigned integer on the emonhub receive side so the logged value is close to 2^32. It seems that the emonTxV3CM firmware producing a negative (capacitive) reactive power is sensible but maybe I’m missing something else. I’m wondering if the logging side should be interpreting that value as a signed int instead of unsigned. Being an open source project, I can obviously make the change myself but I’m wondering if this is the correct thing to do in this case.

Finally, the last paragraph of your previous response made me curious about the range of reactive power that can be measured by the emonTxV3CM firmware. Hypothetically, if I were to replace my resistive load with a purely reactive one, say purely capacitive so the phase lead is 90 degrees. Such a load would obviously produce a large phase difference between the v.t and c.t sensors. Can the firmware accurately measure such a phase lead or is there some limit to the range of reactive power that the firmware will tolerate?

Many thanks,

So I poked at the code more carefully and I see that the E in the payload isn’t reactive power but rather Watt-hours - I had a preconceived notion of the variable E from circuits 101. Sorry about that. So I guess I’m just seeing some residual energy return to the grid based on the initial state of the electrical system at emonTx power-up but over time the integrated energy yields a net use of power. At least, thats what I’m seeing in my logs.

Still curious about the firmware’s response to electrical load phase…

That’s exactly what is happening. The library correctly produces a signed value, but for some unknown reason, somebody assumed that the nett energy can never go negative. That’s no doubt true in a UK winter, maybe even in a whole year, but start up on a sunny day and you will have a nett export - for a while. And the nearer the equator and the more P.V. capacity you have the likelier it becomes. It was corrected in the sketch in V1.8 - we’re now on V2.0.

and I thought in the July 20 release of emonCMS, but apparently not - my copy of the file says

       datacodes = L,h,h,h,h,h,L,L,L,L,h,h,h,L
# should be
#      datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L

But (as you realise) P = Power and E = Energy. We don’t measure vars, we infer a (partially signed) power factor from the definition, knowing real and apparent powers.

I think the answer to that should be very clear from my last paragraph - an emphatic NO. It will be highly inaccurate at very low power factors, because even if the V & I are 90° apart, the outputs of the transformers won’t be, then add the time difference between the two measurements. Part of the problem is establishing the correction required, and the other part is that varies according to the voltage on the v.t. and the current in the c.t. So ideally a 2-D lookup table is needed. I wouldn’t be at all surprised to see your capacitor generating a few watts.

I’ve contemplated getting a motor start capacitor to make use of that so that I can measure or set the correction accurately, as I’d be looking for a zero rather than a flat peak. But the problem is, I can’t suggest to most users that they calibrate their emonTx or emonPi like that.

Nor even EMF.