EMONTX_SHIELD - Need help to configure sketch - ESP Easy Mega

Thanks for your responses.

So i need an other Emontx shield for my Phase 2 to calculate the volatage correctly right ?

Br,

Cnopix

I don’t know. Only you know your system, what you need to tell us is how much different the Phase 2 voltage is, and why it is different - because on any “normal” 3-phase system, the 3 line voltages should be exactly the same. In the real world, we know that will happen only rarely, but they should be nearly the same, to within a few percent of each other.

Are you trying to say that, when the Solar is generating, the Phase 2 voltage rises to such an extent that there is a big difference between it and the other two phases? And when it is not, the three voltages are much closer together?

Je ne sais pas. Vous seul connaissez votre système, ce que vous devez nous dire, c’est à quel point la tension de la phase 2 est différente et pourquoi elle est différente - car sur tout système triphasé “normal”, les 3 tensions de ligne doivent être exactement les mêmes. Dans le monde réel, nous savons que cela n’arrivera que rarement, mais ils devraient être presque identiques, à quelques pour cent près l’un de l’autre.

Essayez-vous de dire que, lorsque le solaire génère, la tension de la phase 2 augmente à un point tel qu’il y a une grande différence entre elle et les deux autres phases ? Et quand ce n’est pas le cas, les trois tensions sont beaucoup plus proches ?

not really a big difference.

On phase 1 and 3 : 235V
On phase 2 : 235 - 240V (depend if solar is generating).

maybe i need to more calibrate my sketch.

i check when i come home :slight_smile:

Thanks.

Cnopix

I would say that is fairly normal- as i see the same when I am generating solar the voltage on that side is slightly higher on that line usually 3-4 volts . just the same as when you put a high current load on the other side will drop the voltage to that side in comparison to the other … it comes down whether it is pushing ( pushing current in the voltages goes up as in generating ) or pulling ( pulling current and voltage drops as in usage) you probably could create a mathematical equation to compensate for that by measuring the output at the inverter and the measurement at the main fuse panel- to calculate the difference in load sharing between either inputs to give estimated value of what voltage would be in the line –

If the difference is about 5 V in 240, that’s about 2%. If you adjust the current calibration for Phase 2 by about 1%, then it will distribute the error between generating and consuming, so it will tend to average out and come closer overall.

If you want to be really clever, then as @stephen says, you can detect the sign of the power on Phase 2 and change the current calibration constant in the sketch accordingly.

The place to do it is after line 820, when the real power is calculated. You need to check if realPower2 is negative, and if so, multiply it by a fixed value (say 1.02) - or if you want to be really, really clever, make it proportional to the power itself (so the correction becomes proportional to power², which sounds wrong but we’re actually using power as an alias for current), and you must do the same to apparentPower2, otherwise you will have wrong power factors calculated. Ideally, you should make the proportionality a variable and store it in EEPROM along with the rest, to save recompiling if you want to adjust the value.

so, i make test.

when i use the sketch : Howto --emonTx - Shield ESPEASY and WEMOS R3 UNO

i have correct voltage but the W was not correcte.

if i use a W metter i see 1500W but with my arduino i see 750W. ( i test with an electrical heater)

i put this for calibration :

if (CT1) ct1.current(1, 60.606); // Setup emonTX CT channel (ADC input,calibration)
if (CT2) ct2.current(2, 60.606); // Calibration factor = CT ratio / burden resistance
if (CT3) ct3.current(3, 60.606); // emonTx Shield Calibration factor = (100A /0.05A) / 33 Ohms
if (CT4) ct4.current(4, 60.606);

if (CT1) ct1.voltage(0, 253.755, 1.7); // New calibration = existing calibration × (correct reading ÷ emonTx reading)
if (CT2) ct2.voltage(0, 253.755, 1.7);
if (CT3) ct3.voltage(0, 253.755, 1.7);
if (CT4) ct4.voltage(0, 253.755, 1.7);

my clamp : 100A/0.05A

but i don’t understand why i don’t have the same value.

Br,

Cnopix

I live in Canada my power is different - it split phase mine is 120V/240 in my local condition

To understand the implications of Stephen’s comment, read the page in Learn about using the emonTx in North America (USA & Canada share the same system: 120 - 0 - 120 V, so their a.c. adapter normally measures one 120 V leg and assumes the voltage on the other leg is matched (they aren’t phases, it’s one winding of a 240 V transformer secondary with an earthed centre tap).

Your current calibration is obviously wrong.

There are two parts to the calibration - the ratio of mains input voltage (or mains current) to the voltage presented to the ADC, and the ratio of the number out of the ADC to that voltage.

What is the ADC input range of your processor’s analogue input?

If that is not the value that emonLib uses in the calibration, then both current and voltage measurements will be wrong by the same proportion.

I suspect it is that which is wrong. What you’ve probably done is corrected the voltage calibration to get that part correct, but not done the same with the current.

ok so i need to check calibration.

if i see in sketch :
ADC input, calibration,phase_shift)
ADC input => 235.5 (check with multimeter)
Calibration => 260 for EU
Phase_Shift => ??

where can i find information, i check in learn but i can’t find solution.

What is the ADC input range of your processor’s analogue input? => where can i find this info ?

For information i’m from Belgium.

My AC adaptor :

Br,

Cnopix

I have no information about the ESPEASY and what the ADC reference voltage is. Without that, I cannot calculate the correct Current Calibration Constant.

What you can do - and this will calibrate your Shield to your “W metter” - is adjust the current calibration constant so that the power to your heater as measured by the Shield is the same as the W metter reports.

This is the page you need: Learn→Electricity Monitoring→Current & Voltage→1. Calibration Procedure→Calibration Procedure

If you cannot measure current, then if you have calibrated the voltage correctly, adjusting the current calibration to give the same power is equivalent. But you must first adjust the phase angle calibration as this will affect the power measurement. Then go back and check the phase calibration - go from one to the other and back again until everything is correct.

i find this page before, thanks :slight_smile:

but i don’t find how to calculate correct value .

this is my ADC:

in the sketch i find to line for calibration :

(CT1) ct1.current(1, 60.606) => i have clamp 100A/0.05 and i check the burden resistance on the Shield and i have 33 Ohms so i thing that this calibration was correct.

if (CT1) ct1.voltage(0, 253.755, 1.7) => this is the line for voltage calibration right ?

on my ADC i see 230-240VAC, this is the information that i need to calculate ?

Blockquote
But you must first adjust the phase angle calibration

it’s possible to calculate this information ?

Br,

Cnopix

No, that is your a.c. adapter. The ADC is the Analogue to Digital Converter inside the ATMega328P processor on your Wemos.

60.606 is the number you must change. You wrote earlier:

Therefore, my first guess for the correct value there is 60.606 × 1500 ÷ 750 = 121.212

Correct. The number 253.755 is correct - you said the voltage reading is correct. Do not change this.
The number 1.7 is the one you must change to get the phase calibration correct.

Not unless you send your a.c. adapter to me and I measure it. I have measured the UK version - but the EU version is different. 1.7 might be correct, but it might not be. It is only a “best fit” number - it corrects for three separate things, two of which vary according to the voltage and current being measured.

ESPEASY is software or more correctly, firmware.

Ref:

https://espeasy.readthedocs.io/en/latest/

ho ok,

i thing that i just need to put 60.606 because the calc is : (100A/0.05A)/33Ohms but i need to caluibrate this number too.

ok, i check that :slight_smile:

thanks.

Cnopix

That is only true for the emonTx Shield and a genuine Arduino Uno. If your ESPEASY reports the wrong hardware type, or the ADC reference voltage is not 5 V, or a combination of these things, then it is another number inside emonLib that is wrong, which is causing the error. That number is the result of this calculation inside emonLib:

((SupplyVoltage/1000.0) / (ADC_COUNTS))

And if either SupplyVoltage or ADC_COUNTS are wrongly detected, then your calibration is wrong. The rest of the calculation to give I_RATIO is

  double I_RATIO = ICAL *((SupplyVoltage/1000.0) / (ADC_COUNTS));

ICAL is your 60.606 number, so you can see that changing that achieves the same result as correcting either SupplyVoltage or ADC_COUNTS. V_RATIO comes from a very similar calculation, and your power is

realPower = V_RATIO * I_RATIO * sumP / numberOfSamples;

it’s seems to be better now :slight_smile:

i need to in a few days if it’s correct or not :wink:

Thaks for your help Robert.

Cnopix.

You cannot expect the theoretical values to give you an exact value, all components are subject to manufacturing tolerances (the c.t. and a.c. adapter are ±3% each), then there are all the components in the Shield, and the Wemos itself.

hey Robert,

it’s working great since a lot of days :slight_smile:

i have just one issue on my phase1. when i don’t use any power, i see that the amout of wats is negatif (between -30 and -35W).

Do you have an idea about this issue ?

i test a new calibration,i change the Clamp with phase 2 or 3 but same result.

Br,

Cnopix

Is this when the c.t. is taken off its cable, or when it is on the cable but no current is flowing?

It is not unusual to see a small current - 35 W ≡ 160 mA - and this is with the emonTx Shield that can measure up to 100 A - it is almost certainly due to electrical noise, either coming from your 5 V power supply, or generated within the Wemos itself. If you have another 5 V power supply, it is worth trying that. Alternatively, some users have found that using the 7 - 12 V d.c. input is better, if you have a power supply that is suitable - ideally NOT a switched-mode - you could also try that.

it’s when no current is flowing.

it’s happened on all clamp if i put all on the same cable.

i check if i have another power supply to check :wink:

Br,

Cnopix