Duty Cycle and data posting

OK...maybe I'm overthinking things here...but I have a question I'm not able to find the answer to.  I am creating my own hardware/software to monitor multiple branch circuits.  I'm going to use an external A-D chip, the MCP3208 which supports 8 channels of A-D at a max sample rate of 100K samples per second.  The idea is that 1 channel is voltage and the other 7 are current.  I'll measure the voltage and then 7 current measurements and use the phase shift calculations.  I have all of that and am comfortable.

The question I really have is what about the cycles that are happening while you are doing "other work"...other work is stuff like sampling other sensors or sending data, etc.  I'm guessing there is some assumption about averaging here.  The code I'm looking at is:

https://github.com/openenergymonitor/emonTxFirmware/blob/master/emonTxV3...

I don't really understand where the "I used x number of watts in the last minute"...or "since the last time I sent data" comes in.

I see where we are accumulating the power with:

sumP1 += phaseShiftedV1 * filteredI1;

and then we are calculating the power:

realPower1 = V_Ratio * I_Ratio1 * sumP1 / numberOfPowerSamples;

but again...what happens while we are not taking samples?

Thanks for helping me understand...I've come a long way, but there are still things I don't quite understand.

Curtis

Robert Wall's picture

Re: Duty Cycle and data posting

That is a "discrete sample" sketch and it does what it says - it takes a discrete sample of power averaged over 10 cycles (by default) every 10 s (by default). You have no idea what happens in between, which is why we recommend the "continuous" sketches if you have rapidly switching loads. (There is no 3-phase "continuous" sketch at present - it's on my 'to do' list.) What you do with the numbers in the database and afterwards depends on what assumption you make. You can assume a linear interpolation between values, or a constant of either value. One of the emonCMS experts will tell you what that does depending on which set-up you choose. The general assumption is that the 'end effect' is minimal and over time averages out (but it may well not if you have an energy diverter or an induction hob or similar).

Comment viewing options

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