new build, readings are miles out

hi.
just completed a new build (emontx and emonglcd & rasppi) from parts from the shop. 2 x ct sensors and a 9v adapter.
it all works. but the readings are nonsense...it shows 12kw when i am drawing about 1.6kw
the other solar input is wrong too.

i have attempted to read all the theory and calibration stuff but i cant get my head round it.

should it be reasonably accurate as is? i am wondering what i have wrong...any obvious ideas.
i am a bit new to this!

thanks.

Paul Reed's picture

Re: new build, readings are miles out

I'm having possibly similar problems too.

With no CT's plugged into the EmonTX, I get (as you would expect) zero power recorded after it settles down, but as soon as I plug in the 9VAC, the power figures jump up to about 13kW - still with no inputs.

The Voltage calibrates fine, the DS18B20 reads OK, and it is transmitting data to a RaspPi OK.

Spent 2 days now checking and double checking everything.

calypso_rae's picture

Re: new build, readings are miles out

If anyone is having fundamental problems with measuring power, why not try out some of the tools in my summary pageMinAndMaxValues and RawSamplesTool (as below) will show you exactly what values your sensors are recording.

At a recent course at the CAT, several emonTx constructors took advantage of these tools.  With the standard 100A/50mA CT, and a burden resistor of 18R, the current waveform for a 120 W load was invariably found to span only around 4 steps of the ADC's range.  The standard CT sensor arrangement therefore appears to be scaled for around 25 kW max.

To provide optimal sensitivity, there is a handy calculator on one of the Building Blocks pages.  My preferred value of 150R appears to be good for around 23 Amps which sounds right to me.   I've always aimed for a p-t-p swing of 3-4 V when monitoring a 3 kW load (13 Amps) with a 5V Arduino.  If running on 3.3V, the values will need to be adjusted accordingly.

 

 

Robert Wall's picture

Re: new build, readings are miles out

I assume you both have checked the assembly against the photographs for mis-identified components or whiskers of solder etc?  Have all the pins of the processor gone into the socket? (I have known one miss and fold up underneath.)

The voltage input and ct1 input are on adjacent pins. Is there a connection between the two?

If there was a connection between pins 25 and 26, it almost implies you don't have a burden resistor fitted, or that the decoupling capacitor C9 (10 uF) is not doing its stuff.

What happens to the voltage readings if you short-circuit the burden resistor for ct1?

What d.c. and a.c voltages do you measure on the ct and voltage input pins of the processor (depending on your meter, you may need to use a series capacitor to remove any d.c. when measuring the a.c. component). D.C. you should see 1.65 V or thereabouts, a.c. you should see about 1 V on the voltage, zero on the others (with the c.t. disconnected or no current flowing).

Mattnj: Do you get similar results?

The pins are:
ct2 23
ct3 24
V    25
ct1 26

I've got to admit I can't spot a simple mechanism that would give this fault.

 

 

calypso_rae's picture

Re: new build, readings are miles out

The display below suggests that CT and CT2 are somehow linked.  Both of these values (the first two columns) should remain at zero when the AC supply is applied.  It seems strange that CT3 is not affected ...

The standard sketch repeatedly calls the library routine calcVI() to do the business.  If the results are not coming back as expected, then something is not as it should be.  Assuming that the library routine itself is sound, then the problem must lie in the hardware or the sketch itself.  To investigate this, a proven sketch that simply provides access to the raw sampled data should be able to shed more light on what is going wrong.

 

Robert Wall's picture

Re: new build, readings are miles out

But more to the point, about 65% input to ct1 is apparently cross-talked from the voltage, yet the voltage appears to be spot on. That's what was puzzling me.

I've just checked emonLib and the sketch on Git and excepting a minor calibration constant change, the files are OK.

Can both of you download and install a fresh copy of emonLib, and a fresh copy of emonTx_CT123_Voltage.ino, and compile and run it with no changes (forget RF, Node, calibration even - provided you're using a standard adapter!), and report the results?

mattnj's picture

Re: new build, readings are miles out

I have just tried uploading emonTx_CT123 and it works fine. Makes no difference if the 9v is plugged in or not.

I have also re downloaded then uploaded the emonTx_CT123_Voltage and its the same, currently using about 2.5kw and its reading 5.5kw.

Board looks ok visually. will look at the tools mentioned above next.

 

mattnj's picture

Re: new build, readings are miles out

hi, i get this from the RawSamplesTool:-

 

 

0
No of cycles recorded = 3
cycleCount 254,  samplesRecorded 230
|                                      cv                                       |
|                                      c.                                v      |
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                          v            |
|                                  v   c.                                       |
|     v                                c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
|                               v      c.                                       |
|                                      c.                      v                |
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                       c                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.     v                                 |
|              v                       c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
|                    v                 c.                                       |
|                                      c.            v                          |
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                                       v
|                                      c.                v                      |
|                        v             c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
v                                      c.                                       |
|         v                            c.                                       |
minVoltage 0,  maxVoltage 1023,  minCurrent 511,  maxCurrent 512

Raw data from stored cycle: <Vsample>,<Isample>[cr]
230, <<< No of sample pairs
520,511
746,511
936,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
867,511
658,511
453,511
266,511
84,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
203,511
410,511
611,511
808,511
991,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,512
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
799,511
591,511
391,511
204,511
30,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
64,511
281,511
492,511
690,511
883,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
1023,511
943,511
729,511
513,511
327,511
139,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
0,511
131,511
345,511

calypso_rae's picture

Re: new build, readings are miles out

Hi Matt, this display shows very nicely what's going on. 

First, the good news.  Both of your sensors appear to be nicely centred, so your reference supply is/are fine.  Your current sensor also seems to be working (assuming that you are measuring some current, that is).  And given that your system is recording data OK, nothing seems to have broken.

Unfortunately, the signal from your voltage sensor is FAR too big.  For virtually all of each mains cycle, you are feeding a signal to the ATMEGA chip that is well outside the range of its input sensor.  As is explained in the relevant Building Blocks page, the 240V mains voltage has to be reduced to have a peak-to-peak span of less than 5V.

The first stage of this reduction is via an AC/AC step-down transformer.  The second stage is by using a pair of resistors which step down the voltage still further.  You need to change your divider-chain resistors (R1 & R2) until the entire waveform lies within the limits of my RawSampleTool's output.  80% of the available range is about right.  Check that you've got R1 and R2 the right way around!

You're actually using a later version of the tool (probably RawSampleTool_4ss_2) which records three cycle's worth of data and then sends all the raw samples to the Serial Monitor for uploading to a spreadsheet.  Given the nature of the voltage samples that the logic is having to deal with, I'm pleasantly surprised to see that it's working as well as it is.

Paul Reed's picture

Re: new build, readings are miles out

OK, downloaded a fresh copy of the sketch & library, and uploaded it without any alterations whatsoever.

Pretty much the same as before (except that the first reading is now negative and not positive as before)

calypso_rae's picture

Re: new build, readings are miles out

I've never used this sketch myself, but the system clearly needs some time for everything to settle. 

Once the AC voltage source has been applied, the voltage samples will acquire an AC content that they did not have before.  That could conceivably then appear in the power value for any related power calculation, eveb though no current is flowing through the CT.. 

The sketch appears to call calcVI() three times, one for each CT, and then go to sleep for several seconds.  After each period of inactivity, during which time all of the HP filters are inactive, it wakes up and performs another three consecutive calls to calcVI().  It seems to me that what we're seeing is just the settling of the voltage samples, or more specifically the HP filter that is associated with them.  For each call to calcVI(), the filter's output becomes more settled.    That's why the result from CT3 is pretty much zero.

I don't see how the hp filters can be expected to work straight away without allowing sufficient time for them to settle.  Each period of measurement in this sketch appears to be only 0.2 seconds.  In my Mk2 PV Router sketches, all filters work continuously so they never need any time to settle except at startup. 

 

mattnj's picture

Re: new build, readings are miles out

ok, I found a problem! I had 2 x 100k resistors in there, not a 10k and a 100k. (that was caused by me being sent one short so replacing it with my own.,,,,which was in and incorrectly labelled bag!)

I have fixed that, and cheked the pins....I get 1.65v on the offset (between the 470k resisitors) and about 1v AC measured between the AC divider....

New Output from the tool is below.....which is with AC plugged in, but no CT clamps connected.

It is still overreading on the house consumption, solar looks ok (I still need to confirm solar is good)

 

No of cycles recorded = 3
cycleCount 254,  samplesRecorded 227
|                                   v c .                                       |
|                                     c .v                                      |
|                                     c .      v                                |
|                                     c .           v                           |
|                                     c .               v                       |
|                                     c .                   v                   |
|                                     c .                       v               |
|                                     c .                           v           |
|                                     c .                              v        |
|                                     c .                                 v     |
|                                     c .                                 v     |
|                                     c .                                 v     |
|                                     c .                                v      |
|                                     c .                              v        |
|                                     c .                          v            |
|                                     c .                     v                 |
|                                     c .               v                       |
|                                     c .         v                             |
|                                     c .   v                                   |
|                                     c .                                       |
|                                v    c .                                       |
|                          v          c .                                       |
|                      v              c .                                       |
|                 v                   c .                                       |
|             v                       c .                                       |
|         v                           c .                                       |
|     v                               c .                                       |
|  v                                  c .                                       |
|v                                    c .                                       |
v                                     c .                                       |
|v                                    c .                                       |
| v                                   c .                                       |
|   v                                 c .                                       |
|       v                             c .                                       |
|            v                        c .                                       |
|                  v                  c .                                       |
|                        v            c .                                       |
|                              v      c .                                       |
|                                    vc .                                       |
|                                     c .  v                                    |
|                                     c .       v                               |
|                                     c .           v                           |
|                                     c .                v                      |
|                                     c .                    v                  |
|                                     c .                        v              |
|                                     c .                            v          |
|                                     c .                               v       |
|                                     c .                                 v     |
|                                     c .                                 v     |
|                                     c .                                 v     |
|                                     c .                                v      |
|                                     c .                             v         |
|                                     c .                         v             |
|                                     c .                    v                  |
|                                     c .              v                        |
|                                     c .        v                              |
|                                     c .  v                                    |
|                                    vc .                                       |
|                               v     c .                                       |
|                          v          c .                                       |
|                     v               c .                                       |
|                v                    c .                                       |
|            v                        c .                                       |
|        v                            c .                                       |
|    v                                c .                                       |
| v                                   c .                                       |
|v                                    c .                                       |
v                                     c .                                       |
|v                                    c .                                       |
| v                                   c .                                       |
|    v                                c .                                       |
|        v                            c .                                       |
|             v                       c .                                       |
|                   v                 c .                                       |
|                         v           c .                                       |
|                               v     c .                                       |
|                                     c .                                       |
|                                     c .  v                                    |
|                                     c .        v                              |
|                                     c .            v                          |
|                                     c .                 v                     |
|                                     c .                     v                 |
|                                     c .                         v             |
|                                     c .                            v          |
|                                     c .                               v       |
|                                     c .                                 v     |
|                                     c .                                 v     |
|                                     c .                                 v     |
|                                     c .                               v       |
|                                     c .                             v         |
|                                     c .                        v              |
|                                     c .                   v                   |
|                                     c .             v                         |
|                                     c .       v                               |
|                                     c .v                                      |
|                                   v c .                                       |
|                              v      c .                                       |
|                        v            c .                                       |
|                    v                c .                                       |
|                v                    c .                                       |
|           v                         c .                                       |
|       v                             c .                                       |
|    v                                c .                                       |
| v                                   c .                                       |
|v                                    c .                                       |
v                                     c .                                       |
|v                                    c .                                       |
| v                                   c .                                       |
|    v                                c .                                       |
|         v                           c .                                       |
|              v                      c .                                       |
|                    v                c .                                       |
|                          v          c .                                       |
|                                 v   c .                                       |
minVoltage 11,  maxVoltage 955,  minCurrent 493,  maxCurrent 494

Raw data from stored cycle: <Vsample>,<Isample>[cr]
227, <<< No of sample pairs
462,493
504,493
536,493
568,493
602,493
634,493
666,493
695,493
722,493
748,493
774,493
800,493
826,493
852,493
877,493
899,493
919,493
936,493
947,493
952,493
954,493
955,493
952,493
947,493
940,493
929,493
913,493
891,493
863,493
831,493
797,493
760,493
723,493
686,493
647,493
607,493
566,493
528,493
490,493
455,493
423,493
391,493
358,493
326,493
295,493
266,493
239,493
213,493
187,493
160,493
134,493
109,493
85,493
63,493
43,493
27,493
17,493
13,493
12,493
11,493
14,493
19,493
27,493
39,493
56,493
79,493
107,494
140,493
176,493
211,493
248,493
286,493
325,493
364,493
405,493
443,493
482,493
516,493
550,493
582,493
615,493
647,493
677,493
706,493
732,493
758,493
784,493
811,493
836,493
863,494
886,493
908,493
927,493
942,493
950,493
953,494
955,493
954,493
951,494
944,493
936,493
924,493
905,493
881,493
851,493
818,493
782,493
746,493
710,493
672,493
632,493
592,493
552,493
514,493
477,493
443,493
412,493
378,493
346,493
314,493
283,494
255,493
229,493
203,493
177,493
150,494
125,493
98,493
76,494
54,493
36,493
22,493
15,493
12,493
11,493
12,493
16,493
23,493
32,493
45,493
65,493
90,493
121,493
155,493
190,493
227,493
264,493
302,493
341,493
381,493
421,494
460,493
497,493
529,493
561,494
594,493
627,494
659,493
688,493
716,494
742,494
768,493
794,494
820,494
846,493
872,494
895,493
915,493
933,493
945,494
952,494
954,493
955,493
954,493
949,494
942,493
933,493
918,493
897,493
870,494
839,493
805,493
768,493
732,494
694,493
656,494
616,494
576,494
536,493
498,494
463,493
429,493
397,493
364,494
332,493
301,493
272,494
244,493
219,493
193,494
166,493
140,493
115,494
90,493
68,493
48,493
31,493
20,493
14,493
12,493
12,493
13,493
18,493
25,493
36,493
52,493
74,493
101,493
134,493
168,493
203,493
240,493
277,493
315,493
355,493
395,493
435,493

 

 

 

 

mattnj's picture

Re: new build, readings are miles out

looks like it is CT1 that is dodgy....as the readings are better on on CT2, and when swapped round.

The offset voltage looks good on CT1 too at 1.6v

 

pins are all sitting at 1.6v with no CT connected

ct2 23

ct3 24

ct1 26

Something is still very wrong i think!

 

Paul Reed's picture

Re: new build, readings are miles out

Thanks for all the comments, but I'm moving to Plan B!
I have a spare EmonTX PCB, and intend to rebuild the whole thing again from scratch, only re-using the resistors (which I will meter check) and sockets (visual check), I will also fit a new Atmega328 + DIL base.

I could spend forever pursuing Plan A, and I need to get this working!

I'll try and recycle the original PCB, Atmega & RFM12B as a Temperature node.

Paul

Robert Wall's picture

Re: new build, readings are miles out

Paul:

The sketch does require a little time (= a number of calls to the library) for the filters to settle, as they obviously only update during the time when readings are being processed, and freeze during the 10s wait in between.

But they do appear to have settled. Everything appears to be working properly - except you have a massive signal on ct1 and less of a signal on ct2, that appears to be coming from the voltage input. Which is itself working fine, and that seems to rule out power supply problems.

There has got to be at least two faults with your build. Either a whisker of solder or maybe a faulty pcb. Can you pop the i.c. out and measure resistance between the processor input pins for the voltage and the c.t's? There are capacitors around (the decoupling ones for the mid-rail bias), so give them time to charge/discharge. I see around 470 k, which is exactly what I expect.

The pins again are:
ct2 23
ct3 24
V    25
ct1 26

If there is a short between 25 & 26, I'd expect the next-to-zero impedance of the c.t. input to reduce the voltage to almost zero, and that isn't happening. A short would only do what is happening if it was relatively high resistance >> 10 k, and there was no burden resistor fitted in ct1.

The only other possibility is the ground plane is broken. Can you check continuity between the earthy end of the 470 k divider resistors and the negative end of the decoupling capacitors (8 places in all) and the supply earth?

calypso_rae's picture

Re: new build, readings are miles out

Yes, that looks much better.  It might be a good idea to alter one of those resistors a bit more to allow some headroom.  80% of the ADC range is ideal.

Are you running with a 5V Arduino, for which 2.5V is the mid-point, or a 3.3V emonTx (for which 1.65V would be the correct value)?

The readings from your current sensor look fine, albeit slightly on the low side.  Maybe your resistors are not perfectly matched.  The small step-change whenever the voltage crosses the mid-point is just an unhelpful effect of the font.  With a fixed-width font, it goes away.

|                                     c .         v                             |
|                                     c .   v                                   |
|                                     c .                                       |
|                                v    c .                                       |
|                          v          c .                                       |
|                      v              c .                                       |



|                                     c .         v                             |
|                                     c .   v                                   |
|                                     c .                                       |
|                                v    c .                                       |
|                          v          c .                                       |
|                      v              c .                                       |
 

 

Paul Reed's picture

Re: new build, readings are miles out

Thanks Robert but I'm now past the point of no return!
The PCB is stripped down and the new one almost complete.

Whilst disassembling, I have checked the joints, pcb and components (those that I am re-using) and have found nothing amiss so far, but before fitting the RFM12P or Atmega, I'm going to spend some time with my meter checking the inputs just to make sure.

Hopefully I'll finish it tomorrow morning!

Paul

mattnj's picture

Re: new build, readings are miles out

my thread has been hijacked! ;-)

Paul Reed's picture

Re: new build, readings are miles out

Sorry mattnj, I thought that we had the same problem initially, but obviously not, it's branched into 2

This is my last post in your thread...   honest 

Paul

calypso_rae's picture

Re: new build, readings are miles out

The sketch does require a little time (= a number of calls to the library) for the filters to settle, as they obviously only update during the time when readings are being processed, and freeze during the 10s wait in between.

I don't understand how the power calculation can be expected to start up correctly from cold with minimal time for the filters to settle.  The readings for CTs 1,2 and 3 are taken in rapid succession and appear to get progressively less bad.  If their order were to be reversed, I feel sure that the outcome would still be first = worst, last = best.

How about adding an extra call to calcVI() with a longer period, say 100 crossings rather than just 20.  That would allow the system to settle.  Then the three existing calls can be made, and I feel sure they would all give good results.

 

Robert Wall's picture

Re: new build, readings are miles out

mattnj:

"looks like it is CT1 that is dodgy....as the readings are better on on CT2, and when swapped round."

Are these numbers powers from the three c.t.'s but with no c.t. connected?

ct1 26
ct2 23
ct3 24

If so, those are about what we expect. A certain amount of noise gets into the analogue inputs from the digital side, gets rectified in the software and appears as a low number of watts. It's been suggested elsewhere that a 2n2 capacitor connected from the input pin to ground cures this, I haven't checked what the side-effects might be.

 

mattnj's picture

Re: new build, readings are miles out

I think I have sorted it....CT2 input was working fine as the solar input.

Voltage reads right (1.631v) on my meter, on pins 26/23/24, but it was always adding on 1.8kw to the actual reading on CT1 (even with nothing connected to CT inputs)

I have just changed the code so that CT3 is read and sent out as CT1 and it all works fine, chip must be faulty, I need to do a little more testing to confirm, but it appears to work now as it should. Except I can only read 2 CTs (number 2 and number 3)

Thanks for the help

 

 

 

 

ct1.calcVI(20,2000);                                                  // Calculate all. No.of crossings, time-out
  emontx.power1 = ct3.realPower;
  Serial.print(emontx.power1);
 
  emontx.Vrms = ct1.Vrms*100;                                          // AC Mains rms voltage
 
  if (CT2) { 
    ct2.calcVI(20,2000);                                               //ct.calcVI(number of crossings to sample, time out (ms) if no waveform is detected)                                        
    emontx.power2 = ct2.realPower;
    Serial.print(" "); Serial.print(emontx.power2);
  }

  if (CT3) {
    ct3.calcVI(20,2000);
    emontx.power3 = ct1.realPower;
    Serial.print(" "); Serial.print(emontx.power3);

calypso_rae's picture

Re: new build, readings are miles out

Before blaming the hardware, mattnj, have you tried my suggestion of adding an extra call to calcVI() with a longer period specified so that the system can settle down?

On a course last week, several people build emonTx boards from scratch, and their background power values were pretty much nil.  I certainly wouldn't expect to see a backgound value of anything like 20 Watts when measuring both V and I.  The odd thing is that all students were all using the same sketch, emonTx_CT123_Voltage.ino, which appeared to behave fine.

 

mattnj's picture

Re: new build, readings are miles out

hi.
i dont understand what you are suggesting.
i have a background value of 1800w always. but the offset value on the pin is correct at 1.65v ish.
if i ignore this pin and use the other pin (ct3) it works perfectly.

why would/should i need to change from the standard software. (which is proven to work)

calypso_rae's picture

Re: new build, readings are miles out

The reference value of 1.65V ish is fine if you're using a 3.3V system.

If no current is flowing through your CTs, then no power should be being detected by any of them.  Your results should be:

0  0  0  240

If you're instead seeing something like:

12345   123    1   240

   then that suggests to me that something is settling.  My suggestion is that you add an extra up-front call to calcVI(), which includes plenty of time for the filters to settle, something like:

ct1 = calcVI(100, 2000);

Then, when you do the original three calls and display their results, you will hopefully get result lines like:

 0  0  0  240

  because all of the settling will have taken place during the first (dummy) call to calcVI. 

But that's only my suggestion.

 

mattnj's picture

Re: new build, readings are miles out

thanks for the suggestion, I am just lost on why I need to alter code that works ok for others. It it outside of my understanding unfortunately.

where are you seeing these values from??

12345   123    1   240

I am wondering if you are referring to values that  the other poster who has hijacked my thread has put here?

Robert Wall's picture

Re: new build, readings are miles out

mattnj

What Robin (calypso_rae) is saying is the digital filters - like any other filter - need time to settle. If you power up/restart your emonTx and then leave it sending readings for a minute or two, the filters will have had time to settle and it should give steady and accurate readings. If, with the c.t.'s removed from the cables and away from any transformers or motors that could give out a magnetic field, after that minute or two then you get readings of current (small fractions of an amp), or small powers (a few watts) I think all seems to be well, because those are the sort of numbers that we regularly see and are due we think to low level digital signals creeping into the analogue inputs. Any bigger numbers are a fault.

Here are the numbers from an old CT123_Voltage sketch (albeit with the wrong voltage adapter constant) and modified to show all the values from each c.t. The measurement was "calcVI(20,2000);" and as you can see, it took about 12 times around the loop for the filters to settle.  It is reading about 150 - 200 mA but only a few watts with a very poor power factor. All of that is not true - no c.t's are plugged in, so it should be reading zero on all 3 channels.

emonTX CT123 Voltage example
OpenEnergyMonitor.org
Node: 10 Freq: 433Mhz Network: 210
V= 235.60
CT1 I= 62.70 P= 6784.44 VA= 14772.55 pf= 0.46
CT2 I= 64.15 P= 7259.93 VA= 15804.01 pf= 0.46
CT3 I= 65.75 P= 8451.29 VA= 17088.57 pf= 0.49

V= 253.78
CT1 I= 20.51 P= 1273.25 VA= 5203.73 pf= 0.24
CT2 I= 19.38 P= 749.73 VA= 4816.77 pf= 0.16
CT3 I= 18.97 P= 965.25 VA= 4786.65 pf= 0.20

V= 257.12
CT1 I= 8.93 P= 290.94 VA= 2295.54 pf= 0.13
CT2 I= 8.15 P= 96.62 VA= 2069.45 pf= 0.05
CT3 I= 7.74 P= 224.56 VA= 1977.45 pf= 0.11

V= 257.79
CT1 I= 4.36 P= 102.37 VA= 1122.66 pf= 0.09
CT2 I= 3.92 P= 9.63 VA= 999.57 pf= 0.01
CT3 I= 3.66 P= 77.53 VA= 933.67 pf= 0.08

V= 257.55
CT1 I= 2.21 P= 37.31 VA= 569.18 pf= 0.07
CT2 I= 1.98 P= -1.20 VA= 503.54 pf= -0.00
CT3 I= 1.80 P= 30.12 VA= 458.94 pf= 0.07

V= 257.42
CT1 I= 1.15 P= 17.78 VA= 295.05 pf= 0.06
CT2 I= 1.02 P= -3.66 VA= 259.20 pf= -0.01
CT3 I= 0.93 P= 14.25 VA= 236.54 pf= 0.06

V= 257.12
CT1 I= 0.59 P= 12.34 VA= 152.23 pf= 0.08
CT2 I= 0.54 P= 1.80 VA= 136.59 pf= 0.01
CT3 I= 0.49 P= 8.27 VA= 124.41 pf= 0.07

V= 257.31
CT1 I= 0.34 P= 6.94 VA= 88.27 pf= 0.08
CT2 I= 0.32 P= 3.33 VA= 80.36 pf= 0.04
CT3 I= 0.29 P= 5.97 VA= 75.16 pf= 0.08

V= 257.24
CT1 I= 0.23 P= 4.98 VA= 59.94 pf= 0.08
CT2 I= 0.21 P= 5.08 VA= 54.53 pf= 0.09
CT3 I= 0.20 P= 10.27 VA= 50.79 pf= 0.20

V= 257.37
CT1 I= 0.18 P= 0.97 VA= 46.76 pf= 0.02
CT2 I= 0.19 P= 1.22 VA= 48.88 pf= 0.03
CT3 I= 0.17 P= 6.29 VA= 43.91 pf= 0.14

V= 257.46
CT1 I= 0.18 P= 5.15 VA= 46.63 pf= 0.11
CT2 I= 0.18 P= 6.82 VA= 45.49 pf= 0.15
CT3 I= 0.17 P= 5.63 VA= 44.57 pf= 0.13

V= 257.36
CT1 I= 0.18 P= 4.30 VA= 47.38 pf= 0.09
CT2 I= 0.15 P= 6.15 VA= 37.44 pf= 0.16
CT3 I= 0.17 P= 4.17 VA= 44.23 pf= 0.09

V= 257.45
CT1 I= 0.18 P= 4.68 VA= 46.48 pf= 0.10
CT2 I= 0.14 P= 5.79 VA= 36.96 pf= 0.16
CT3 I= 0.18 P= 5.40 VA= 46.12 pf= 0.12

V= 257.46
CT1 I= 0.18 P= 3.13 VA= 45.73 pf= 0.07
CT2 I= 0.14 P= 5.10 VA= 36.84 pf= 0.14
CT3 I= 0.18 P= 4.71 VA= 45.70 pf= 0.10

 

mattnj's picture

Re: new build, readings are miles out

ok, i get that....in my case, its shows 1800w with CT clamp plugged in, or not on CT1 if it is left for 10secs or 1 hour.

If i then clamp something with the CT clamp, it basically adds this on, so a 1kw load then shows 2800w.

When i measured the static pin voltage with no CT clamp connected it shows at 1.65v ish (which seems right)

 

When i decided to forget all that, can read from CT2 and CT3, it works perfectly, so I am assuming the CT1 pin 26 is wrong somewhere.

I have ordered a new chip to test out tomorrow and will report back.

 

 

stuart's picture

Re: new build, readings are miles out

mattnj,

 

Does your CT clamp already include a burden resistor?  What resistance value do you have if you measure the tip and ring of the plug ?

 

Think about 100 ohms is normal.

calypso_rae's picture

Re: new build, readings are miles out

its shows 1800w with CT clamp plugged in, or not on CT1 if it is left for 10secs or 1 hour.

Yes, but isn't the sketch regularly going to sleep?  And when it wakes up, doesn't there need to be some time for the filters to settle?  CT1 is the first of the three to be measured, so seems likely to be the worst affected if things haven't settled down fully.

The latest batch of CT's from the OEM shop don't have a burden, just a pair of back-to-back zener diodes (each 22V I think).  If there were to be an internal burden in parallel with an external one, the resulting power values would presumably just be that bit smaller.

Robert Wall's picture

Re: new build, readings are miles out

Yes, but isn't the sketch regularly going to sleep?  And when it wakes up, doesn't there need to be some time for the filters to settle?  CT1 is the first of the three to be measured, so seems likely to be the worst affected if things haven't settled down fully.

Nobody has noticed that problem before! Can you see it in my readings above?

The latest batch of CT's from the OEM shop don't have a burden, just a pair of back-to-back zener diodes (each 22V I think).  If there were to be an internal burden in parallel with an external one, the resulting power values would presumably just be that bit smaller.

As far as I know, the YHDC 100 A c.t. as stocked by the shop has never had an internal burden resistor. The burden has always been on the PCB, and has to be left out if you use the 30 A "voltage output" c.t's that do have internal burdens (and not protection diodes).

calypso_rae's picture

Re: new build, readings are miles out

OK, guys, I'm outta this one.  I only understand systems that keep going continuously, not those that take readings straight after they've been asleep for a while.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.