Rms calculations in EmonLib and Learn documentation

Here you go:
https://learn.openenergymonitor.org/electricity-monitoring/ctac/calibration

I think the executive summary is that you tweak the phase adjustment until RealPower reads the same as ApparentPower while measuring a purely resistive load.

Interesting paper thanks.

Yes, I concur. As you pointed out above, a small phase error is close to unnoticeable with a UPF load but really sticks out at lower PFs.

I’m not particularly familiar with emonlib so I’ll leave you in Robert’s capable hands there, but what your paper describes is not a million miles from how I calibrate away phase errors in my energy IC based monitor. It uses an all-pass filter to add time advances/delays between I and V.

Using a power calibrator (unfortunately too expensive for most home hobbyists) I subject it to two pure 50Hz sine waves precisely 60°out of phase. I then let it accumulate Real and Reactive Energy measurements over an extended period … maybe 20 or 30 seconds depending on how patient I feel. The longer I let it run, the less I’m subjected to quantisation errors. Then I do a tan-1 (Reactive/Real), subtract that from 60° and I have my total phase error (mostly from the CT but also includes various filters etc). That number then goes into a reasonably complex formula (not unlike the ones in your paper) and it spits out the correct coefficient to load into the all-pass filter. Run again with that, and the tan-1 comes out at 60° typically with 2 or 3 decimal places of zeroes after it. I repeat it at 60Hz, and store away the two coefficients, loading them up at runtime based on the observed line frequency.

What I can’t compensate for is varying phase errors due to varying currents. The best I can do there is try to choose CTs that have a fairly flat phase error across the current range. As a rule of thumb, I calibrate at 1/10th the rated current, so for example I calibrate a 20A CT at 2A, i.e. I set the power calibrator to 230V, 2A, 60°phase shift, 50/60Hz.