emonTx_CT123_Voltage 3phase_Master

Not sure whether to put it in hardware or software.

Has anyone dare to take on the challenge to alter the constant Wh reading sketch to support the 3phase hardware described in this thread : http://openenergymonitor.org/emon/node/1170 ?

I quickly ran over the code, but it will probably take me quite some time to get this sorted out.

I build this setup a while ago, since I have a 3 phase system and want to do separate readings of my circuitry.
I've got 3 voltage sensors and 9 CT's in place, measuring positive and negative values. I'm currently struggling with the new emoncms ( I haven't updated in quite some time to be honest), trying to get the my-electric to work. It would be nice to have the total Wh also available with this hardware.

I used to have this configuration for monitoring different totals:

CT1_phase1 : log to feed_phase1
Power to kwh/d : feed_phase1_kwhd
histogram : feed_phase1_hist
+input ct_1_phase2
+input ct_1_phase3
log to feed : feed_phase_all
power to kwh/d : feed_phase_all_kwhd
histogram : feed_phase_all_hist
-input ct_2_phase2 (my solar inverter)
log to feed : feed_real_power_used
power to kwh/d : feed_real_power_used_kwhd
histogram : feed_real_power_used_kwhd

This would provide me with the values and historical timegraphs. If I try to do the same with the new version of emoncms, I don't get right readings for feed_phase_all, even after trying to use the power to kwh and kwh to power functions. I guess that's where the accumulated Wh is being designed for, to use those metrics as a seperate input and create the functions there.

As a side question. Why is the voltage removed from the payload package ? I always found it very nice to have it monitored as with the PV invertors in our grid, the voltage fluctuates a lot here in Belgium and I really liked the ability to graph this.

bond79's picture

Re: emonTx_CT123_Voltage 3phase_Master

I am not sure if you are asking about the sketch or the input setup in emoncms.

If it is the input setup, take a look at my input setup. I haven't used older emoncms versions so I don't know if anything changed on the calculations setup, but this works for me. I am not sure if it is necessary but I am resetting the values to zero and reload the feed/input value when I want to reuse it, after something else was calculated.

Robert Wall's picture

Re: emonTx_CT123_Voltage 3phase_Master

The hardware side:

I have not heard of anyone merging MartinR's 'Full Fat' 3-emonTx V2 sketches and Robin's 'continuous' sketch. I know both reasonably well, and I think it will not be simple because in Martin's original, he uses the serial link between the 3 units to start the conversion in all 3 at the same instant, then the master unit collects the result of the measurement. To do a similar thing with Robin's, you will have to run the ADC continuously, and use the serial link to interrupt the accumulation of the values, send the results to the master and zero the accumulators. You will need to be certain that you have enough spare time in the main loop of the slave units to send the data via the serial link in between processing the result of the ADC in the ISR, and in the master unit you need to receive that plus transmit the values for the 3 phases by radio.

Robin has never been interested in voltage, so none of his diverter sketches, on which the 'continuous' sketch is based, have ever calculated the rms voltage, all they have done is taken the instantaneous value and multiplied it by the current to get power, which is then averaged. You can of course add in the maths to obtain the rms voltage and then include it in the payload, but you will need to check that the processor load is not excessive.

ziporah's picture

Re: emonTx_CT123_Voltage 3phase_Master

Thanks for the reset to zero tip, I didn't think about using that to do the logic. This might come in handy.

Regarding the merge of both sketches. I'm glad I saw the same troubles/issues you are describing Robert. At least my processing of the code was correct and indeed it will be quite a challenge to incorporate this in one sketch. I'm not sure if it is worth the effort. I might be better of trying to build a shield for an arduino mega and do all the processing on one device. That will be quite a challenge too, but at least I won't need to be bothered with an additional sync between the seperate devices.

I found this contribution already : https://github.com/gysmovoile/emonTxFirmware/blob/master/emonTx_Interrupts/emonTX_Interrupts_EthernetAndLCD

So that might be a starting point, the code is still interrupt driven, so it will still take some work to fix it to continuous sampling. I'll first start processing the code and the forums to see what has to be done and then take a shot at it


Robert Wall's picture

Re: emonTx_CT123_Voltage 3phase_Master

A more powerful processor with more inputs might be a better approach. Do a search because I think it's been done before and you might find something useful.
I'm not sure what you mean by "the code is still interrupt driven, so it will still take some work to fix it to continuous sampling". Robin's 'continuous' sketch is interrupt-driven. If you have only one ADC, you will need to be very careful with timing especially as you will be measuring 12 values per cycle (3 currents + 1 voltage, all x 3).

Comment viewing options

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