### EmonTX V3 Three-phase approximation method- questions

Glyn, Trystan, Robert (I think you are the right guys for this one!)

I am building a monitoring system for my company's offices which have two three-phase supplies in different parts of the building. I am planning on using the approximate method with only a single emonTX v3 + voltage sensor. I have the code from Github, but I'm unclear on some of the calibration instructions. The code text is in italics, my comments in bold.

CALIBRATION
Adjust Vcal = 234.26 so that the correct voltage for L1 is displayed.

I assume this means using the correct calibration constant according to voltage sensor used (transformer ratio)?

Adjust Ical1 = 119.0 so that the correct current for L1 is displayed.

Same as above but for the current sensor?

Connect a pure resistive load (e.g. a heater) to L1 and adjust Phasecal1 to display a power factor of 1.00.
Do the same for L2 and L3. If it not possible to keep Phasecal within the range 0 - 2, it is permissible to
change "#define PHASE2 8" and/or "#define PHASE3 18"

N.B. "Phase shifted" means a small adjustment to the voltage waveform to accommodate small ( < 10 degrees) phase shifts in the transformers etc.

This bit I don't follow. Is this to do phase shifts caused by the current and voltage sensors themselves?

Could this calibration method be carried out for each CT separately in a different building (i.e., at my house where I can switch everything off except for an electric heater= the resistive load). I can't do this in the office because it won't be possible to switch everything off (e.g., servers).

Chris

### Re: EmonTX V3 Three-phase approximation method- questions

I assume this means using the correct calibration constant according to voltage sensor used (transformer ratio)?

Yes, and the tolerances of the resistive divider chain and the accuracy of the ADC reference voltage - all are lumped together unless you've calibrated the ADC reference separately (emonTx V2 only).

Same as above but for the current sensor?

Yes, and the tolerance of the burden resistor and... [the ADC as above]

This bit I don't follow.

I'm not surprised. This is where it gets tricky. For the L1 c.t, that is indeed the case, and you can do it at home as you say. For the other two, that is only part of the story because the phase calibration is also compensating for the array elements not being 120° electrical apart. The best you can do off-site is adjust the phase calibration for the correct 'wrong' values given that the voltage is being delayed by 120° and 240° compared to the current. The fiddle factor is of course cos(120°) = cos(240°) = -0.5, so the power should be exactly half and negative, and the power factor -0.5 also - best done with all 3 c.t's on the same cable and comparing L2 and L3 against L1.
[This is the only way I was able to verify that sketch as I don't have access to a 3-phase supply.]

For some time, I've meant to modify Martin Roberts' PLL sketch for the approximate 3-phase method. If that were to measure 48 or 51 samples per cycle, there would always be an array element at exactly 120° and 240° whatever the frequency, calibration would be a lot simpler, and accuracy would not be frequency-dependent.

### Re: EmonTX V3 Three-phase approximation method- questions

Hi Robert,

So for L1 CT I can calibrate at home.

For the other two, I can do the same but need to calibrate it based on the phase-shifted values, so changing the Phasecal parameters on this line;

double Phasecal1 = 1.00;                         // Calibration constant for phase shift L1
double Phasecal2 = 1.35;                         // Calibration constant for phase shift L2
double Phasecal3 = 1.37;                         // Calibration constant for phase shift L3

What do these numbers actually mean?

Do I also need to calibrate the voltage sensor?

Chris

### Re: EmonTX V3 Three-phase approximation method- questions

The easy one first - yes, you do need to calibrate the voltage input.

Phasecal1 as you said relates to the difference between the phase errors of the voltage and current transformers plus the time delay between the two readings.

For the other two (and you need to study the sketch to understand this) the voltage readings (phase 1) are stored in an array and read out a number of samples later. No sample accurately lines up with the 120° and 240° required, and as Phasecal interpolates/extrapolates between voltage samples anyway, that is used as the fine adjustment to align the delayed voltage to I2 or I3. The Building Blocks page about the Phasecal algorithm tells you how it works in detail.

### Re: EmonTX V3 Three-phase approximation method- questions

Ok, I think I'm getting there.

To summarise;

The voltage and current readings have to be calibrated because;

1. There is a delay between sampling V and I as a result of the time taken to run these lines of code.

2. The CTs and Voltage Sensor also create a small phase difference

The method is;

1. Set up system with a purely resistive load

2. Connect CT1 and adjust PhaseCal1 until the power factor for the line is unity (or a close as possible).

3. Do the same for CT2 and CT3 but this time adjust PhaseCal2 and 3 until powerfactor is -0.5 (because the voltage sample data is being delayed by 120 and 240deg).

Would it be sensible to first work out theoretical values for PhaseCal for each phase based on computational time?

Is it likely that the three CTs (which are identical models) will have very different phase shifts, and that therefore I should always ensure I use the same one for each phase?

### Re: EmonTX V3 Three-phase approximation method- questions

All that is correct. It probably isn't worth the trouble trying to calculate the phase errors. Although the 3 c.t's are supposed to be the same, and they're probably close enough, they might not be. The values I put in the sketch should be reasonably close anyway and should only require a minimal tweak.

But realise you can never get it perfect. If the mains frequency changes, the delay will be wrong (because 120° electrical won't take the same time), and the phase errors in the transformers depend on the flux, which depends on the voltage and current for the respective transformers. So you can get it perfectly right only when the combination of frequency, current and voltage all adds up to give the same time delay. The trick is to get it good enough.

Provided your loads are close to resistive (which they should be if the power supply designers have done their stuff), then the consequences of the phase error will be marginal anyway. It's only when the power factor is abysmal that it really matters.

### Re: EmonTX V3 Three-phase approximation method- questions

Finally got around to doing this.

I have calibrated for each CT with a single voltage adapter. I've tried to make my setup as resistive as possible, with a 3kW electric heater on full blast, and nothing else one- except for my desktop pc which I'm using to run serial monitor in (a laptop would have been useful here). The values of PhaseCal and the power factors are;

 Phasecal Power Factor Phasecal1=1.0 1.00 Phasecal2=0.82 -0.50 Phasecal3=0.5 -0.50

The values for Phasecal2 and 3 are very different to what you had put in the sketch, and seem to be delaying the waveform rather than pulling it forward. Do you think something is wrong here?

Note I tried using a different (i.e., a fourth) CT for each line and it gave the same results as above except for CT2 which gave PF=-0.57 (Phasecal2=0.82). So the CTs themselves seem to be fairly consistent (except for CT2).

Another question- why is Phasecal1 set to 1.0 (including in your example sketch)? The building blocks page says this should be 1.28 to account for sampling delay.

Chris

### Re: EmonTX V3 Three-phase approximation method- questions

You've got to remember that this is an approximate method, and you're using different hardware to that which I used. We know the old Mascot adapter and the old grey-lead YHDC c.t. are both different to the present equivalents. So I wouldn't worry too much. The values for L2 & L2 are the 'fine' adjustment anyway, the 'coarse' adjustment is the array element you use. You're probably better off having a phasecal in the range 0 - 1 as this is interpolation. Greater than 1 is extrapolation.

There are three variables that affect phasecal: the phase errors of the two wound components and the time shift between readings. At the end of the day, the right phasecal is the one that gives the right answer. 1.28 is the correction for the sampling delay assuming the other two are equal - a risky assumption that depends on choosing the right voltage, current and components!

### Re: EmonTX V3 Three-phase approximation method- questions

Hi,

I've finally got around to installing the three-phase system. I have an emonTX V3 with voltage transformer, and 3xCTs connected to each phase. I am using the RPi gateway forwarder method to send data to emoncms.org.

The power values I'm getting are;

power1 = -477

power2 = -1614

power3= 79

voltage= 251

I'm confused as to why I am getting negative power values! The CT clamps are all aligned facing the same way, with the arrows pointing to the load. I haven't changed anything in Robert's sketch, except for the phasecal values (as indicated in the thread), which I calibrated using a resistive load.

Any thoughts?

Chris

### Re: EmonTX V3 Three-phase approximation method- questions

There are two possible reasons: The phase of the voltage is wrong, or the ct's are on the wrong phases. The absolute value (which way the CT needs to face to get a positive power when importing - if that's the convention you want to follow - doesn't matter, they just need to be consistent.

Forget CTs 2 & 3, CT1 must be on the phase where you are measuring the voltage. Get that right first. Then CT2 goes on the phase that follows that, and CT3 on the one that's left. When you look at the sketch, it should all become obvious. CT2 current is multiplied by a delayed version of Line 1's voltage to give the power on Line 2, and for Line 3 an even more delayed version is used.

### Re: EmonTX V3 Three-phase approximation method- questions

Sorted it, thanks, very obvious now!

Hopefully will start getting some decent results and can compare accuracy with the supplier meter.

Chris