3 phase delta generator

OK, I understand. maybe there is one more question to be sure, namely whether the frequency should run at 50/60 Hz because I will measure the voltage and current on a generator so that the frequency that comes out will change.

A very difficult question. What range of frequencies do you think you will see in operation?

The library was of course designed with the normal public electricity supply in mind, which is usually stable to better than 1%. This means that it was safe to use a count of cycles to calculate the interval between reports (i.e. the averaging time for the power, voltage and current) and to calculate the compensation for phase error in the voltage and current transformers. If your generator output varies over a large range, then those things will be wrong. I don’t know how important the second of these (phase error) will be to you, and in any case I do not have the facilities to test a transformer at anything other than 50 Hz, so I cannot tell you what the error might be at another frequency. Related to this, your voltage and current transformers will also show a reduced output as the frequency falls below 50 Hz. Again, I’ve not been able to make accurate measurements but it is something to remember.

The timing problem should be a lot easier to solve: you need to decide when to end the “datalogging period” based on time alone, and the number of actual samples as set by the ADC clock is the most convenient quantity to use, so instead of the end being after a set number of cycles (cycleCountForDatalogging), it needs to be at the zero crossing immediately after the time you require. (You should average over a complete number of whole cycles for the average to be accurate, so starting and ending on the positive-going zero crossing of the same phase voltage.)

A count of mains cycles is also used to decide when to command the temperature sensors to start taking a reading - this is another change you need to make if you are measuring temperature; if not, you can ignore this.

I appreciate this will be quite a complicated problem for you, I cannot rewrite emonLibCM for you because I’m working on the emonPi3, but be assured I’ll help as much as I can as time allows.

OK, thank you very much for your help. I will try to brainstorm the library that you have created for the tool that I will create. Thank you for your help so far