Understanding PHASECAL

I’m wading in late here and it looks like this has been nailed down.

I looked at PHASECAL recently thought to share and emphasise what I found…

that it introduces Distortion that is distinct from the Phase Correction. The higher the phasecal value, the greater the amplitude Distortion. PHASECAL only works well for small phase errors. The original Atmel paper is opaque on this point if I remember right.

It uses a method called Linear Interpolation, and therefore makes very significant assumptions. If PHASECAL is modelled in a spreadsheet the Linear problem can be easily seen with phasecal values of 4 and above I found, which introduce an amplitude error, or distortion as we’re calling it… Not the same as phase shift.

Robert and others have discussed the merits of Sinusoidal Interpolation instead, elsewhere on the forum, which are worth a look at in contrast to PHASECAL. The Sinusoidal method still suffers a flaw of assuming both V and I are sinusoidal, which obviously won’t be true for some loads, but it’s much better than phasecal’s linear method for phase-shifts above, say about, 5 degrees I think.

Careful Dan, you’re typing and not thinking again. Current has nothing to do with PHASECAL, it’s only the voltage that’s shifted.

And, I thought we’d known that the phasecal algorithm isn’t perfect for a long time.

Tricky arriving late. True, one gets chosen to shift over the other normally, and that’s V since it tends to retain it’s shape better than current.

Yeah but it’s flaws aren’t quite so obviously documented… or just obvious… so enter these more detailed exchanges with yourself and whomever is into it. All good.
Maybe we’ll chat sinusoidal some day. I’m cheating, almost, with this buffer-index-shifting stm32 malarkey.

It’s an interesting result. Yours is not the first monitor to do simultaneous V and I conversions with parallel ADCs, but in general that hasn’t been found to do away with the need for phase error adjustments. The only way I know of to do away with them is to get rid of all the magnetics in the sensors - so shunts for measuring I and resistor dividers for measuring V - but each of those options come with significant safety concerns and should only be built and installed by qualified people.

Out of interest, what brand/model of VT and CT are you using for your tests? What’s the typical grid voltage at your location?

Indeed, I was about to mention that it must be coincidence that the voltage and current transformers just happen to have identical phase shifts, but that it’s very likely those will change if either quantity changes - but the degree of change will depend greatly on the quality of those transformers.

Not that it matters a lot, but it’s actually just 1 ADC with 4 sample and hold’s inputs (as the name says, samples the signal and holds it until the ADC gets it for each one of the inputs).

I’m from Portugal so it’s 230V 50Hz.

The voltage transformer I’m using on my design is a FS12-090-C2:
It’s used solely for voltage sensing. It was one of the smallest/cheapest that I found on Mouser (where I usually do the shopping).
I’m considering ordering the one with more amp’s (FS12-500-C2) and use one of the secondary windings to power the board, but it usually turns out to cause a lot of distortion on the other secondary winding used for voltage sensing.

Also I recently “discovered” and ordered a couple of ZMPT101B (just the transformer) from ebay to make some tests and eventually use in the next board revision if they prove to be better than the one above.

And the current transformer is one of those “SCT013 30A/1V” from ebay…

Interestingly, the data sheet doesn’t seem to anticipate its use as a pure voltage sensor, because there’s no mention of phase error.

On paper, and with the right multiplier and burden resistors, that does appear to be attractive, having minimal phase shift. But of course it also implies your current transformer also needs to have the identical minimal phase shift, which I think the SCT-013-030 cannot claim. You might be disappointed by the overall result, and find you need to add compensation for the c.t’s phase error.