emonTx with alternative CT's and 3-phase

I have a good teacher :slight_smile:

So let’s assume we got there in the end again with finding the phases, connecting CT’s correct, connecting AC:AC adapter correct and changing the current calibration constants.

I did change the Vcal in the sketch to 260. I will try to measure voltage and then change it accordingly.

The “scales” is not in my emonhub.conf but I guess it is just to add it in the right spot.

I’m more in to changing burden resistors and current calibration to suit my house because that feels more “right” to do. I started digging in to what my house maximum current is, it turns out I am paying for a maximum of 20 A. I then spoke again with my electrician and he probably thinks we can lower it to 16 A, he just needed to rethink about what impact my solar PV has on this matter (it is 7.39kW).

So maybe I would need to change burden resistors and currency calibration numbers in the sketch, what do you think ?

I am not sure I believe your electrician. If you go back to post no.4:

Your CT will give you a secondary current of 83.33 mA at 25 A primary current. Ideally, your emonTx wants to have 1.1 V across the burden resistor at maximum current, so that gives a burden value of 13.2 Ω The burden resistor already fitted is 22 Ω, therefore you should add a parallel resistor (there are holes provided for a wire-ended one) of 33 Ω. That will give you exactly 25 A as the maximum current you can read. The calibration factor in the sketch should be changed to 22.727.
If you do not add the parallel resistor, the maximum current will be about 15 A, which I think is too low (your heat pump will account for nearly 12 A per phase, leaving only 3 A for everything else on any one phase).

You solar inverter will supply a little more than 10 A per phase. If you are using zero in the house, it will export 10 A. If you are using more than 10 A, you will import the difference. Therefore your maximum current will be when it is dark and the inverter is contributing nothing, and you have your heat pump plus any other appliances in use.

I would be cautious about changing your burden resistor.
You could remove the 33 Ω and replace it with a higher value:
Let’s say we design for 18 A maximum:
The c.t. secondary current will be 60 mA, the combined burden must be 18.33 Ω, therefore we want 100 Ω in parallel with the original 22 Ω. There are some approximations and rounding in there, so working backwards, that will give you a maximum current of 18.3 A (and a current calibration factor of 16.636).
Or if you had 150 Ω in parallel instead, you would have a maximum current of 17.2 A (and a current calibration factor of 15.636).

If you can get 1% tolerance resistors, that will mean your calibration will be that much more accurate.

(Note: if you are not using the 4th channel, there is no need to change the resistor!)

I don’t believe you do not have a “scales = …” in your emonhub.conf, I think you were not looking in the right place. You should be looking under the nodeID for your emonTx, which is probably NodeID=11:

    nodename = 3phase
    [[[rx]]]
       names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacode = h,h,h,h,h,h,h,h,h,h,h,L
       scales = 1,1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
       units =W,W,W,W,V,C,C,C,C,C,C,p

You should change only one: either the calibration factors in the emonTx or the scales in emonhub.conf, not both. I agree, the more “natural” place is in the emonTx. Unfortunately, many people don’t have a programmer so they cannot change the calibration there.

Well, the thing about my heat pump is that it is rated at 8kW but uses only 2-4 kW, never seen it go above that. “Basic or everyday use” uses 2kW and then steps of 1-2kW up to 8kW total when its extra cold in the wintertime but it seems to be dimensioned to not having to use more than max 4kW…I guess it has to do with my house being well isolated and the geothermic hole in the ground providing good temperatures

Anyhow. I’m loosing you in the calculations I’m afraid. So given my information, your idea for me right now and what you think is best for accuracy is to keep the burden resistors and keep the value 22.727 in the sketch ? And maybe hack the accuracy in emonhub.conf scale.

A normal night here would be standby-use around 500w, heat pump on and off consuming 2-3000w, so if I understand everything correct, at night, my house is consuming between 500 and 3000w, maybe up to 5000w in the wintertime, short periods.

This is my info from /etc/emonhub/emonhub.conf under nodes:

[nodes]

# List of nodes by node ID
# 'datacode' is default for node and 'datacodes' are per value data codes.
# if both are present 'datacode' is ignored in favour of 'datacodes'
[[99]]
        datacode = h
        datacodes = l, h, h, h,

Found this now in the archived forum, probably this is why my NODE section is empty. But I guess I’m able to populate it to set scale.

Assuming you are using v1.2 (original) emonhub and a "stock" emontx v3 you shouldn't need to define the node, you can if you wish but it shouldn't be mandatory as it's payload only has signed integers so no other datatypes force the need for defining the node. Plus you are not using the nodes module and the input module doesn't make defining nodes mandatory either, so you should be good with an empty [nodes] section.

You can add the node as it is defined in the sketch - copy & paste from the sketch** into emonhub.conf. (Use a web browser and the on-screen edit button, because there are several copies of emonhub.conf in various places.)

If you have a [nodes] section, then emonhub can be very useful. It will throw out data that does not belong to a node it is expecting, and if you use the plural forms in post 62** (names, datacodes, scales, etc), it will throw out data that is not consistent with what it expects (so a missing value will mean the whole message is rejected, and it won’t enter wrong data into your database).

Then you can adjust the scale for any of the inputs. But note that each is quite independent here: changing the voltage scale will not affect the power, whereas adjusting the voltage calibration in the emonTx will adjust the power because it happens before the power is calculated.
I think the correct way is to set the burden resistors for the maximum current that you can possibly take. That way, you are safe and will not risk overloading the electronics.

You total power of 5 kW is not everything, we need to know how it is shared over the three phases, and we should also take power factor into account. So even though 5 kW is 7.25 A per phase for a unity power factor load when it is shared equally across the 3 phases, there is every reason to think that is not the case in reality and one phase could be drawing a lot more current than that simple calculation gives.

If you do increase the sensitivity of the emonTx inputs, what you are really doing is improving the accuracy at very small loads. In practice, we find that the accuracy is fairly good to well below 1% of maximum.

The calculations are relatively simple:
Decide the maximum current that you want to measure.
Calculate the c.t. secondary current from that, because you know the c.t. ratio (in your case, divide by 300).
You want 1.1 V across the burden resistor (this is a safe value, and includes an allowance for component tolerances etc). Use Ohm’s Law to find the resistance you need: resistance = voltage / current.
If you have two resistors in parallel (as you have), their effective conductance is the sum of their individual conductances, and conductance = 1 / resistance, a very easy sum to do with a calculator with a (1/x) function.
Finally, the calibration factor = c.t. ratio / burden resistance.

** There is a mistake in the sketch, which I copied into post 62. It should read
datacodes = ..." (not datacode = )

[quote=“Robert.Wall, post:65, topic:2421”]
If you have two resistors in parallel[/quote]

Or…

Product divided by the sum.

Less buttons to press my way…
22 // 100

My way:
[2] [2] [1/x] [ + ] [1] [0] [0] [1/x] [ = ] [1/x] RESULT

Your way:
[2] [2] [×] [1] [0] [0] [÷] [ ( ] [2] [2] [ + ] [1] [0] [0] [ ) ] [ = ] RESULT

It may be easier with RPN but I don’t have & don’t understand that.

Also worth noting: replace [ + ] with [ - ] to find the parallel resistor you want when you know the value you need for the pair in parallel.

Mr Łukasiewicz’ system has always escaped me too.

Hmmm… I would have entered 2200 / 122 = which works out to nine keystrokes.
But only becase that particular product and sum are easy to do in your head.

Given values like 47 and 68, not so easy (for me) and then yes, one has to perform all of the keystrokes.

Using conductances, it does mean that you only need to enter the values once.

Ok, been struggling a bit with emonhub.conf

Did add the emonhub.conf example from the sketch, first tried to edit the /etc/emonhub/emonhub.conf a couple of times via terminal/SSH. Then went on to install the “emonHub Config Module” to be able to do it via web browser as you mentioned. It does, though complain about that the emonhub.conf needs to be located in /home/pi/data/emonhub.conf, that folder does not even exist on my RPI.

So I created the folder and the file. Edited, saved, restarted numerous times. Added 2, and even 4 to the scale to see if it worked. I can’t get inputs to change though. Did use NodeID 11 as in the sketch. So its like its not even listening to the file.

I know very little about the emonPi, I’m afraid I’ll have to leave that to someone else to help you there. You can always stay with Plan A, do the calibration in the sketch and undo all the changes in the emonPi.

Thank you Robert for all support! I will continue trying to calibrate and then move on to finding out best solution to run emonhub and openhab together and so on.

Give me a heads up if you ever come to the middle/northern part of Sweden and I’ll be happy to give you a tour of my house and accommodation if you need!

That’s very kind of you, but I’m afraid I am not likely to take you up on your offer - I’m not a good traveller.

Ok! I’ve read up a little on calibration and looked at my meter outside while at the same time controlling my numbers on the emonTx.

Yesterday in the evening when my heat pump was operating i got these readings.

Meter:

L3 (input 1) showing 700 to much on emonTx
L1 (input 2) showing 300 to much on emonTx
L2 (input 3) showing 100 to much on emonTx

Total effect reported 2500w on my meter

emonTx was then reporting around 3600w all together.

Today with less load:

L3 (input 1) showing 150 to much on emonTx
L1 (input 2) almost equal as shown on emonTx
L2 (input 3) showing 100 to much on emonTx

So the marginal of error/difference seems to differ given the loads at the moment, this is probably as it should be I guess ?

I did manage to do the same calculations as you did to find my secondary current of my ct’s (83mA) and the current constant. But how do I understand and recalculate the current constant to match the readings of my house meter ? Or is it a case of trial and error ? In that case, do I need to start raise the constant or lower it ?

You can do it by trial and error, or you can simply change the constant by the ratio of the wanted reading to the actual reading - the constant is multiplier, so to reduce the reading you reduce the calibration constant.

Have you gone through the full calibration procedure that is in the comments at the beginning of the sketch? Because the calibration should not be wrong by the amount that it is, as compared with the calculated value - unless your c.t’s are not what we think they are, of course.