The cycle count is whatever I end up with after two crossings, although I occasionally have to discard a set of samples when the count is low - indicating that the ESP8266 serviced an interrupt while I was collecting samples.
So let me start at the top again:
The shifting in the VTs and CTs is not simply a constant time shift of the entire cycle. It is a convoluted thing that appears to be greater when the slope is steep, and less when the slope is flatter. This can cause introduce error into the measurements. I think we can all agree on that.
The mechanism available for mitigating (correcting not a good term here) the error is to shift one set of data points relative to the other. When we do that, we shift all of the data points, so the net effect will be a change in the power factor by the angle represented by the shift. For instance, if there were 720 data points collected evenly throughout the cycle, shifting one set of points by 7 would represent an angle of 3.5deg.
So we can do this to mitigate the error, but the question is āwhat is the angleā?
Back to my initial post. By using the power factor calculations (or a phasor diagram - same thing), on the output of the transformer vs the primary (unity load for CT), you get an angle that, if used to shift an entire cycle evenly, will have the effect of mitigating the error.
This number is not the same as the phase shift that you will get from the traditional phase shift measurement methods. It is always smaller.
The phase correction number in IoTaWatt is not the phase difference in the traditional EE sense. It is the angle that the data must be shifted by, to mitigate the error introduced by the waveform distortion of the transformer.
To carry this a step further. There are two transformers involved. The VT and CT. Both exhibit leading shift. The mitigation angles for both components are provided in the configuration tables, and the net shift is computed for each CT/VT pair. That net shift is applied to the data after each sampling when the data is crunched for real power.
Itās not a question of whether phase correction is used, itās where you get the data to determine how to do it.
Youāre right, the Solar Edge inverter has a high power factor. The closer to unity, the less the effect of the phase distortion. Nevertheless, it is important to mitigate the distortion correctly.
My heat pump runs at pf .89 - 27 degrees. I have a revenue grade meter on it (EKM) and also monitor it with IoTaWatt. Over the last5 weeks the EKM meter says I used 514.3 kWh. IoTaWatt says I used 514.0 kWh. This is without any calibration or adjustment. The correction for the VT and CT are straight out of the tables.
If the shift needed to mitigate the VT error were off by 2 degrees, the difference between the traditional phase measurement and the measurements Iām advocating, the pf would be 25 degrees or .91. That would be a 2% difference, yet the two agree.
This isnāt about the importance of mitigating the phase distortion, that, thatās a given, itās about how you mitigate it, and my point is that you have to do power-factor type calculations to determine how much simple phase shifting is needed. Time will tell with IoTaWatt. There are quite a few out there now. Iām confident the accuracy will surpass the legacy equipment without the need to reprogram and calibrate.
If you have any more questions about how it works, the firmware is on GitHub.